Revision: 4980 Author: wikipedian Date: 2008-02-05 16:47:56 +0000 (Tue, 05 Feb 2008)
Log Message: ----------- encoding fix for parameters in Hungarian Windows XP (experimental)
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-02-05 10:09:21 UTC (rev 4979) +++ trunk/pywikipedia/wikipedia.py 2008-02-05 16:47:56 UTC (rev 4980) @@ -5198,10 +5198,15 @@ return args[0]
def decodeArg(arg): - if sys.platform=='win32' and config.console_encoding == 'cp850': - # Western Windows versions give parameters encoded as windows-1252 - # even though the console encoding is cp850. - return unicode(arg, 'windows-1252') + if sys.platform=='win32': + if config.console_encoding == 'cp850': + # Western Windows versions give parameters encoded as windows-1252 + # even though the console encoding is cp850. + return unicode(arg, 'windows-1252') + elif config.console_encoding == 'cp852': + # Central/Eastern European Windows versions give parameters encoded + # as windows-1250 even though the console encoding is cp852. + return unicode(arg, 'windows-1250') else: # Linux uses the same encoding for both. # I don't know how non-Western Windows versions behave.
pywikipedia-l@lists.wikimedia.org