Re: Improving i18n support (Was: Re: Christmas
- From: Kevin Kenny <kennykb@xxxxxxx>
- Date: Fri, 29 Dec 2006 01:09:54 -0500
Larry W. Virden wrote:
The most surprising thing to me, as a developer, is that I'm expected
to use obscure binary/octal/hex codes when attempting to write unicode
strings . That seems so... archaic.
That's surely a restriction of whatever editor you're using, not of Tcl.
Message catalogs are encoded in UTF-8, so you've always been able to use
Unicode there (Well, since 8.1, when Tcl first became Unicode-aware).
On this point, I know whereof I speak: I've committed several message
catalogs for KHIM in the last few months, including one for Czech,
which not only uses non-ASCII characters, but non-Latin-1 characters.
While the [source] command defaults to platform-native encoding,
and [source -encoding] and '-encoding' on the command line are 8.5
features, you can also do:
set file [open $path r]
fconfigure $file -encoding utf-8;# or whatever encoding you like
eval [read $file]
close $file
which does the same thing as [source] but is encoding-aware.
Well, [info script] doesn't work, and there are a few other niggling
details, but everything can be worked around. So
Unicode is available in ordinary Tcl scripts as well.
I quite routinely put non-ASCII characters in my string literals
nowadays.
--
73 de ke9tv/2, Kevin
.
- Follow-Ups:
- Re: Improving i18n support (Was: Re: Christmas
- From: Larry W. Virden
- Re: Improving i18n support (Was: Re: Christmas
- References:
- Christmas
- From: Ian Bell
- Re: Christmas
- From: jkj
- Re: Christmas
- From: Stephan Kuhagen
- Re: Christmas
- From: Andreas Leitgeb
- Re: Christmas
- From: Donal K. Fellows
- Improving i18n support (Was: Re: Christmas
- From: Larry W. Virden
- Re: Improving i18n support (Was: Re: Christmas
- From: Donal K. Fellows
- Re: Improving i18n support (Was: Re: Christmas
- From: Larry W. Virden
- Christmas
- Prev by Date: images in menus not quite right
- Next by Date: Re: Is Tcl work for large programs?
- Previous by thread: Re: Improving i18n support (Was: Re: Christmas
- Next by thread: Re: Improving i18n support (Was: Re: Christmas
- Index(es):
Relevant Pages
|