[GRASS-dev] fonts and character encoding

Michael Barton michael.barton at asu.edu
Sun May 13 16:51:15 EDT 2007


On 5/12/07 2:08 PM, "Glynn Clements" <glynn at gclements.plus.com> wrote:

>> How do I access locale charmap from TclTk or wxPython?
> 
> Tcl:
> set encoding [exec locale charmap]
> Python:
> encoding = Popen(["locale", "charmap"], stdout=PIPE).communicate()[0].strip()
> 
> AFAICT, the resulting value will be valid for iconv(), and thus for
> $GRASS_FT_ENCODING.
> 
> Needless to say, this won't work on Windows.

I'm reluctant to implement code that doesn't work with windows.

> You can get the Windows
> codepage by parsing the output from "mode con cp /status", although
> there might be better solutions. iconv appears to accept cp??? for
> most of the common ones (e.g. cp437 = US, cp850 = western Europe,
> etc).

Sorry to bother, but how can I get this information from within TclTk or
wxPython? 

Michael

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton





More information about the grass-dev mailing list