[GRASS-dev] fonts and character encoding
Glynn Clements
glynn at gclements.plus.com
Sat May 12 07:44:40 EDT 2007
Michael Barton wrote:
> Do I no longer need to provide a way to manually set character encoding with
> default display fonts (i.e., it accompanies the font)?
Each font has a default encoding, but the user may wish to specify a
different encoding.
Also, it makes a difference where the text is coming from.
If it is being read from a file, the encoding needs to match that used
in the file. But display commands which read text from files should
really have an encoding= option (well, it tends to be named charset=;
if we're going to fix that, it should be sooner rather than later).
If the text is passed as a command-line argument, the encoding needs
to match whatever the GUI uses. Both Python and Tcl/Tk use UTF-8
internally, but (I think) use the locale's encoding when passing text
to system functions which expect a char*, e.g. execve()'s argv
parameter.
So, I think that the GUI should probably set GRASS_FT_ENCODING to the
locale's encoding (e.g. from "locale charmap").
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list