Unicode support inconsistency between menu titles and menu items on Windows
From: Eric Brunel (eric.brunel_at_N0SP4M.com)
Date: 02/25/04
- Next message: Andreas Leitgeb: "Re: Construct request"
- Previous message: anand: "Tcl_FSOpenFileChannel exception in Tcl 8.4 !!!!"
- Next in thread: Benjamin Riefenstahl: "Re: Unicode support inconsistency between menu titles and menu items on Windows"
- Reply: Benjamin Riefenstahl: "Re: Unicode support inconsistency between menu titles and menu items on Windows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 25 Feb 2004 12:12:42 +0100
Hi all,
Consider the following script:
--test-unicode.tcl---------------------
menu .mb
. configure -menu .mb
menu .mb.m1
set s1 "\xe3\x81\xb2\xe3\x82\x89\xe3\x81\x8c\xe3\x81\xaa"
.mb add cascade -label [encoding convertfrom utf-8 $s1] -menu .mb.m1
set s2 "\xe3\x82\xab\xe3\x82\xbf\xe3\x82\xab\xe3\x83\x8a"
.mb.m1 add command -label [encoding convertfrom utf-8 $s2]
menu .mb.m2
set s3 "G\xc3\xa9n\xc3\xa9ration"
.mb add cascade -label [encoding convertfrom utf-8 $s3] -menu .mb.m2
set s4 "Pr\303\251f\303\251rences"
.mb.m2 add command -label [encoding convertfrom utf-8 $s4]
---------------------------------------
The string s1 and s2 contain japanese characters; the strings s3 and s4 contain
french accented letters, all in utf-8 encoding.
Executing this script on Linux or Solaris works as expected: all characters are
displayed.
On a french Windows 2k without any japanese font installed, the japanese
characters are displayed as '?' in the menu title and as squares in the menu
items. The french characters are displayed correctly.
On a french Windows 2k with a japanese font installed, the japanese characters
in menu items are displayed correctly, but not in menu titles: they still show
up as '?'. The french characters are still displayed correctly.
What is the reason for that? Will japanese characters show up correctly on a
Japanese version of Windows? And will the french characters show up? Would it be
different if I had a newer Windows version (namely XP)?
Since I thought every string was managed internally in unicode on Windows, I
also tried to add a "encoding system utf-8" at the top of the script. Then the
non-ASCII characters in menu titles show up completely messed up.
For info, I'm using tcl/tk 8.3.4; "encoding system" returns cp1252
-- - Eric Brunel <eric dot brunel at pragmadev dot com> - PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com
- Next message: Andreas Leitgeb: "Re: Construct request"
- Previous message: anand: "Tcl_FSOpenFileChannel exception in Tcl 8.4 !!!!"
- Next in thread: Benjamin Riefenstahl: "Re: Unicode support inconsistency between menu titles and menu items on Windows"
- Reply: Benjamin Riefenstahl: "Re: Unicode support inconsistency between menu titles and menu items on Windows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|