On Sun, May 24, 2009 at 5:34 PM, John Newman <john.new...@ualberta.ca> wrote: > Apologies if my question is ridiculously trivial - I'm not a developer, just > a relatively new user of Python 3.0.1 on Mac OS 10.4.11. and I have only > just now joined the list. > > When I read in a Chinese text in the Python 3 IDLE GUI on Windows XP I see > all the Chinese glyphs displayed properly. On my Mac, about one third of the > Chinese characters are not displayed correctly (just empty or black boxes in > place of glyphs). It doesn't matter whether I save/open texts as utf-8, > utf-16, etc. [The glyphs display fine in TextEdit, JEdit, Word etc.] And > the same kind of problem occurs when I scroll through the list of font names > in Preferences in IDLE: the names in Chinese glyphs have a number of white > or black boxes instead of the glyphs. > > I just assume that this has something to do with the locale settings in > IDLE? On my machine: > >>>> locale.getpreferredencoding() > 'mac-roman' >>>> locale.getlocale() > (None, None) > > In my Windows XP, the locale settings are (English, '1252') and I presume > that this difference is relevant to understanding the different effects I > get opening Chinese texts in my Windows XP and my Mac. 'mac-roman' would not > be my natural choice of encoding if I am looking at Chinese text! I need an > encoding which can handle the range of glyphs we find in GB 18030, say. > > Am I being naive in thinking that all I have to do in Python is somehow > change the locale settings in some way which will display Chnese glyphs? > I'm at a loss to know what I should do in order to display Chinese glyphs > properly on the Mac. I tried experimenting with "setlocale" but couldn't > make progress. > > Any suggestions would be very welcome. > > John
I don't have any experience with IDLE, but perhaps the font it is using simply doesn't contain those glyphs? I would try changing the font to one you know for sure contains the glyphs you are using. ~ Nathan _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig