Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: henk01Hello Henk,
I was having a good look at language support recently and that�s why this reply is a bit more extensive.
First of all, without any modifications you should be able to retrieve data and write data to output without needing any conversions. If the input file is provided in UTF8 encoding then all temporary files and output files will be in UTF8 too.
This can be most easily checked when using Notepad++ or on Unix (with file �i <filename>).
However, having a file in UTF-8 is not always handy as extended characters are presented as double byte characters, i.e. two characters. Care must be taken when applying string functions such as left(20) as extended characters will cause issues (strings become longer and extended characters could be chopped in half).
When for example applying string functions it would be better to convert the character encoding from UTF8 to windows-1252. LAE uses by default WIN-1252 character encoding, an 8-bit single-byte encoded character set, and a superset of ISO 8859-15. In a BRE viewer you can always change the coding to utf-8 (Preferences -> Set codepage), but that would be simply change the way you view the data.
�zg�n has the right idea by using name.unicode("UTF8"), but then unfortunately the Unicode characters are not converted correctly to file when using the �Output delimited� node. In his graph �zg�n mentions name.unicode("UTF8").str() which is the conversion is back to string format, and the string are now displayed in the windows-1252 encoding. When checking the encoding of the temporary files, this has now changed to ANSI (on Windows using Notepad++) or �iso-8859-1� (on Unix). If the file no longer does contain extended character (e.g. filtered out) then the encoding of the file on Unix will be �us-ascii�. The �Output Delimited� node should now write the data correctly. Attached is a graph demonstrating the conversion which hopefully clarifies the options.
There are a number of threads discussing the limitations of the �Output Delimited� node:
http://community.lavastorm.com/threa...ht=decode+file
http://community.lavastorm.com/threa...ht=decode+file
I hope this helps. So definitely the �blocks�, or �\xd6� can be avoided, and the file will be generated correctly, but in �us-ascii� or �iso-8859-1� encoding rather than �UTF-8�. If the file definitely needs to be in UTF-8 format then on Unix the �iconv� command can be used (using an ExecuteSystemCommand node), and there should be an Windows version as well (and I can provide a sample for that as well if needed).
Best regards,
Henk
Attachments:
UTF8.zip