Revision: 4458 Author: wikipedian Date: 2007-10-17 12:25:57 +0000 (Wed, 17 Oct 2007)
Log Message: ----------- fixed bug [ 1803037 ] windows console encoding problem
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-10-17 09:01:52 UTC (rev 4457) +++ trunk/pywikipedia/wikipedia.py 2007-10-17 12:25:57 UTC (rev 4458) @@ -4926,12 +4926,13 @@ moduleName = calledModuleName() nonGlobalArgs = [] for arg in args[1:]: - if sys.platform=='win32': - # Windows gives parameters encoded as windows-1252, - # regardless of console encoding + 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. arg = unicode(arg, 'windows-1252') else: - # Linux uses the same encoding for both + # Linux uses the same encoding for both. + # I don't know how non-Western Windows versions behave. arg = unicode(arg, config.console_encoding) if arg == '-help': showHelp(moduleName)