Message88077
an immediate thing to do is to declare cp65001 as an encoding:
Index: Lib/encodings/aliases.py
===================================================================
--- Lib/encodings/aliases.py (revision 72757)
+++ Lib/encodings/aliases.py (working copy)
@@ -511,6 +511,7 @@
'utf8' : 'utf_8',
'utf8_ucs2' : 'utf_8',
'utf8_ucs4' : 'utf_8',
+ 'cp65001' : 'utf_8',
## uu_codec codec
#'uu' : 'uu_codec',
This is not enough unfortunately, because the win32 API function
WriteFile() returns the number of characters written, not the number of
(utf8) bytes:
>>> print("\u0124\u0102" + 'abc')
ĤĂabc
c
[44420 refs]
>>>
Additionally, there is a bug in the ReadFile, which returns an empty
string (and no error) when a non-ascii character is entered, which is
the behavior of an EOF condition...
Maybe the solution is to use the win32 console API directly... |
|
Date |
User |
Action |
Args |
2009-05-19 09:46:15 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, tzot, pitrou, vstinner, christian.heimes, mark, ezio.melotti |
2009-05-19 09:46:14 | amaury.forgeotdarc | set | messageid: <1242726374.68.0.248484835786.issue1602@psf.upfronthosting.co.za> |
2009-05-19 09:46:13 | amaury.forgeotdarc | link | issue1602 messages |
2009-05-19 09:46:12 | amaury.forgeotdarc | create | |
|