how to set encoding in text file to UTF8 without BOM

hollydonut
Member Posts: 27
hi all,
i am trying to generate a text file using report, but with encoding set to UTF8 without BOM.
so far i am able to generate the text file but using UTF8 with BOM using adostream.
how to change into UTF8 without BOM?
i am trying to generate a text file using report, but with encoding set to UTF8 without BOM.
so far i am able to generate the text file but using UTF8 with BOM using adostream.
how to change into UTF8 without BOM?
0
Comments
-
Not sure if it helps you in any way, but I had a similar issue a few months back and ended up making the following function. Do be aware that I haven't accounted for all possible characters, just the ones we would need, so you may have to add a few more.
Var Name DataType Subtype Length No InputString Text 500 No AddBOM Boolean I := 1; //If AddBOM is true, add it to the start of the string IF (AddBOM) AND (InputString[1] <> 'ï') THEN BEGIN CHR := 239; InputString := INSSTR(InputString, FORMAT(CHR), 1); CHR := 187; InputString := INSSTR(InputString, FORMAT(CHR), 2); CHR := 191; InputString := INSSTR(InputString, FORMAT(CHR), 3); END; //Convert character WHILE (I <= STRLEN(InputString)) DO BEGIN IF (InputString[I] = 'æ') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 166; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'ø') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 184; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'å') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 165; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'Æ') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 134; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'Ø') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 152; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'Å') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 133; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'à') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 160; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'á') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 161; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'è') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 168; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END ELSE IF (InputString[I] = 'é') THEN BEGIN CHR := 195; InputString[I] := CHR; CHR := 169; InputString := INSSTR(InputString, FORMAT(CHR), I+1); I += 1; END; I += 1; END; EXIT(InputString);
0 -
thank you for the answer, but my customer has decided to change the encoding.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions