http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10048
Revision: 10048 Author: a_engels Date: 2012-03-26 09:42:02 +0000 (Mon, 26 Mar 2012) Log Message: ----------- Reverted my own change in usage of encodings - we should put that advise of using a different font for the command prompt in Windows somewhere prominent!
Modified Paths: -------------- trunk/pywikipedia/userinterfaces/terminal_interface_base.py
Modified: trunk/pywikipedia/userinterfaces/terminal_interface_base.py =================================================================== --- trunk/pywikipedia/userinterfaces/terminal_interface_base.py 2012-03-26 09:35:37 UTC (rev 10047) +++ trunk/pywikipedia/userinterfaces/terminal_interface_base.py 2012-03-26 09:42:02 UTC (rev 10048) @@ -40,7 +40,6 @@ self.stdout = sys.stdout self.stderr = sys.stderr self.encoding = config.console_encoding - self.realencoding = config.console_encoding
def printNonColorized(self, text, targetStream): # We add *** after the text as a whole if anything needed to be colorized. @@ -70,7 +69,7 @@ # Encode our unicode string in the encoding used by the user's console, # and decode it back to unicode. Then we can see which characters # can't be represented in the console encoding. - codecedText = text.encode(self.realencoding, 'replace').decode(self.realencoding) + codecedText = text.encode(self.encoding, 'replace').decode(self.encoding) transliteratedText = '' # Note: A transliteration replacement might be longer than the original # character, e.g. ч is transliterated to ch.