First off, this may or may not be a bug. I just don't know enough about channel transforms to tell. I may be just coding it incorrectly.
The problem is I can't get it to handle unicode. There is a file on the wiki, here,
https://wiki.tcl-lang.org/page/console+for+Unix
I am trying to get this to work on Linux and have written TIP 561 for it. I thought the code was working and only needed to be supported by the core group. However, the code does not work when one does a puts "\uxxxx" but instead outputs 3 garbage characters. I thought the problem was in the initialize fconfigure, that was doing the line below that I've commented out and replaced with the utf-8 encoding:
proc initialize {what x mode} {
# fconfigure $what -buffering none -translation binary
fconfigure $what -buffering none -encoding utf-8
info procs
}
Could someone knowledgeable about this take a look. This code is normally sourced as in,
> wish8.6 (can't run as is on 9.0)
% source console.tcl
% puts "\u277D"
This should output a unicode 8-ball.
Thanks, if this is a bug and can be fixed, it would really help. If it's an error in my code, or just something the channel transforms can't handle, I'd appreciate knowing.
Note, this code as it is will fail on 9.0 totally which I can fix easily by changing some of the private calls to ::tk::ConsoleOutput etc.
So if you test it, please do so on tcl/tk 8.6 not 9.0.
|