Hi Jorge,
I guess it is
supposed to print correctly, but as is often the case, there may be a gap between what we
suppose and what actually
is.
Although presumably you have your own XTREE with UTF8 characters, for testing purposes we can always use the
XTUTF8.BP and accompanying
XTUTF8.CSV data file which contains a nice variety of character sets, including Cyrillic, Japanese, and Greek.
The first problem I notice is that the integrated export to XLSX function doesn't handle them, but that's an issue with CSV2XL, not XTREE or GDI printing. (Let me review that and get back to you.)
But you mention
//TEXTOUT, which suggests that you are somehow converting your XTREE data into //TEXTOUT statements? GDI printing in general, and //TEXTOUT specifically, does support Unicode, but you have to encode any non-ANSI characters using the &#Xhhhh notation (as described in
Printing Special Characters). That would obviously be a pain in the neck to do manually, but fortunately there is an SOSLIB function
Fn'UTF8toGDI$(utf8string$) that will do the dirty work for you.
More generally we might ask why we can't just switch an entire text file over from from ANSI to UTF8. The main reason, I think, is that we have all kinds of text files and no standard framework (like HTML or XML headers) to identify to the application or A-Shell what the encodings are. We could possibly try to support the
BOM (Byte Order Mark) technique, but again, because there have never been any restrictions or assumptions about the contents of a text file, trying to interpret the file contents based on the first 2 characters runs a risk of mis-identification. And that's before we even start to think about the complexities of inserting the UTF8 (or Unicode) translation logic into every routine that processes text characters, from GET.SBR, to INPUT and everything in between. As a practical matter, we probably need to carve out specific areas where the encodings can be unambiguously identified and constrained within reasonable limits (as was done with XTREE). I'm open to suggestions...