43
©2002-2016, Ido Millet, ido@MilletSoftware.com
Page 218
Changing Text File Encoding
This option was developed for a customer who needed to change the encoding of a text export
from ANSI to UFT-8.
The command line argument structure is as follows:
…
"TXT_Encode:InFile||OutFile||fromEncoding>>toEncoding||Options"
The parameters (after the ":") are separated by a "||" and are as follows:
1. InFile: the file path & name for the source text file.
2. OutFile: the file path & name for the resulting text file.
- If no OutFile is specified, the source file gets updated
-
if the target folder doesn’t exist, Visual CUT creates it
- if no path is specified (just name) the path of the source file is used
3. The original and new encoding, separated by
a ‘
>>
’.
4. Options: Leave blank
For example, to convert from ANSI to UTF-8:
…
"TXT_Encode:c:\temp\ {@invN}.xml||c:\temp\{invN}.xml||windows-1252>>utf-8||"
or
…
"TXT_Encode:c:\temp\ {@invN}.xml||||windows-1252>>utf-8||"
Notes:
Valid encoding codes:
us-ascii,unicode,unicodefffe,ebcdic,iso-8859-1,iso-8859-2,iso-8859-3,iso-8859-4,
iso-8859-5,iso-8859-6,iso-8859-7,iso-8859-8,iso-8859-9,iso-8859-13,iso-8859-15,windows-874,windows-1250,
windows-1251,windows-1252,windows-1253,windows-1254,windows-1255,windows-1256,windows-1257,
windows-1258,utf-7,utf-8,utf-32,utf-32be,shift_jis,gb2312,ks_c_5601-1987,big5,iso-2022-jp,iso-2022-kr,euc-jp,
euc-kr,macintosh,x-mac-japanese,x-mac-chinesetrad,x-mac-korean,x-mac-arabic,x-mac-hebrew,x-mac-greek,
x-mac-cyrillic,x-mac-chinesesimp,x-mac-romanian,x-mac-ukrainian,x-mac-thai,x-mac-ce,x-mac-icelandic,x-mac-turkish,x-
mac-croatian,asmo-708,dos-720,dos-862, ibm01140,ibm01141,ibm01142,ibm01143,ibm01144,ibm01145,ibm01146,
ibm01147,ibm01148,ibm01149,ibm037,ibm437,ibm500,ibm737,ibm775,ibm850,ibm852,ibm855,ibm857,ibm00858,
ibm860,ibm861,ibm863,ibm864,ibm865,cp866,ibm869,ibm870,cp875,koi8-r,koi8-u
You can use field or formula names within the command line argument (just like you drag &
drop fields & formulas into the various options in the 3rd tab within Visual CUT). The
dynamic content of these fields/formulas would be substituted into the command line
argument.