John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
Running this under Windows 2000, the character is not shown on the button (nor is a square default character indicating that it's not in the font—and this character should be in all normal Windows fonts). Rather, I see three characters â (E3), unprintable, and ¢ (A2). Clearly it is interpreting the UTF-8 encoding as 3 8-bit characters instead.use strict; use warnings; use utf8; use Tk; ${^WIDE_SYSTEM_CALLS}= 1; my $s= "This is a TM symbol => '\x{2122}',\nU+2122"; my $MW = new MainWindow; my $hello = $MW->Button( -text => $s, -command => sub {print STDOUT $s; } ); $hello->pack; MainLoop;
Is Tk simply UTF8 hostile? If the string for the button is going through the normal mechanism that the core uses, it would convert to UTF-16 and call the Wide form of TextOut (or SetText or whatever) upon seeing the WIDE flag set.
Is it possible to use Unicode with Tk with the right incantations? Any plans for the future?
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unicode in Tk
by bastard (Hermit) on Jul 03, 2001 at 04:14 UTC | |
by John M. Dlugosz (Monsignor) on Jul 03, 2001 at 04:53 UTC | |
by ff (Hermit) on Oct 17, 2002 at 00:11 UTC |