Re: How can I use tcl to read files written in GBK or GB18030 encoding?



On Feb 2, 1:00 pm, David Gravereaux <davyg...@xxxxxxxxx> wrote:
billpo...@xxxxxxxxxxxx wrote:
iconv handles these two encodings, so you might be able just to run
iconv as a child process. Failing that, the iconv source may be
helpful.

How is Tcl to handle the code-points in the 4-byte region, though? I
didn't know it went outside USC-2.


Tcl as it is usually compiled can't handle the codepoints beyond the
BMP, so the output of iconv would have to be filtered. An alternative
is to compile Tcl to handle full Unicode. If the application is plain
Tcl, that is, does not use Tk, that should work.
.