From: Werner F. B. <wer...@fr...> - 2005-05-03 07:17:47
|
I haven't had any feedback on my original post for this, would be great if someone could verify that this works in other configurations, e.g. on Linux or other language then French which uses accented characters in the month name abreviations. The problem is that if a plot shows month names as axes labels. When I run this on a machine in "French" (i.e. on Win XP changing the Settings - Regional and Language settings" to French the labels don't show correctly if there is an accented character in there e.g. "déc". The solution which works for me is to "import locale" and get the default encoding from it. I have tested it on both Win XP and 2000 and it works for me, i.e. in English locale I get "Dec" and in French locale I get "déc." etc. without the correction I would get a graphic sign for the "é". The only two changes needed to dates.py are: import locale and change return dt.strftime(fmt) to return unicode(dt.strftime(fmt), locale.getpreferredencoding()) Best regards Werner Werner F. Bruhin wrote: |