I wrote this script to test behaviour of frozen console applications with non-ASCII chars. Later I used it again: encoding continued.
Here is what this script should output to the console:
Some sentences in different languages: Ännchen Müller machte große Augen. Cède à César les pâturages reçues. Tõesti, ma ütlen teile, see ei ole ükskõik. Overview table with all accented characters: A E I O U a e i o u ¨ Ä Ë Ø Ö Ü ä ë ï ö ü ~ Ã . . Õ . ã . . õ . ´ Á É Ö à é á é í ó ú ` À È Þ ã ë à è ì ò ù ^ Â Ê × â ê â ê î ô û Some system settings related to encodings: locale.getdefaultlocale(): ('de_LU', 'cp1252') sys.getdefaultencoding() : cp1252 sys.getfilesystemencoding() : mbcs sys.stdout.encoding : cp850 sys.stdin.encoding : cp850
Did you see? Some characters are not correctly converted to HTML on the HTML version of this documentation page. An in flagranti proof that this script was worth writing it;-)
(Implemented in Python module diag)
Refering articles:
- Lino snapshot on a Windows PC (10.08.06) — I installed an SVN working copy on an Estonian Windows machine because I wanted to test Landscape printing on Windows. more
- UnicodeEncodeError in diag.py (15.06.06) — diag.py raised a UnicodeEncodeError when the console was unable to display all the special characters, because the StreamWriter had errors='strict'. Now it uses errors='replace' so that unavailable characters are now represented by a '?'. more
- diag.py shows information about Windows default printer (code changes 25.05.06) — diag.py now shows printer information as returned by win32print.GetPrinter(). more
- still encoding (code changes 21.02.06) — I noticed that Lino's sitecustomize leads to problems, and that there are differences between print x and sys.stdout.write(x). more
- frozen console applications with non-ascii chars (code changes 10.03.05) — I started to translate some messages for sync.py, using i18n. I noticed that there was a problem with non-ascii chars, at least on my Windows box. more