[Python-Dev] Unicode literals in Python 2.7
Adam Bartoš
drekin at gmail.com
Sat May 9 14:39:46 CEST 2015
More information about the Python-Dev mailing list
Sat May 9 14:39:46 CEST 2015
- Previous message (by thread): [Python-Dev] Unicode literals in Python 2.7
- Next message (by thread): [Python-Dev] Unicode literals in Python 2.7
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I already have a solution in Python 3 (see https://github.com/Drekin/win-unicode-console, https://pypi.python.org/pypi/win_unicode_console), I was just considering adding support for Python 2 as well. I think I have an working example in Python 2 using ctypes. On Thu, May 7, 2015 at 9:23 PM, "Martin v. Löwis" <martin at v.loewis.de> wrote: > Am 02.05.15 um 21:57 schrieb Adam Bartoš: > > Even if sys.stdin contained a file-like object with proper encoding > > attribute, it wouldn't work since sys.stdin has to be instance of <type > > 'file'>. So the question is, whether it is possible to make a file > instance > > in Python that is also customizable so it may call my code. For the first > > thing, how to change the value of encoding attribute of a file object. > > If, by "in Python", you mean both "in pure Python", and "in Python 2", > then the answer is no. If you can add arbitrary C code, then you might > be able to hack your C library's stdio implementation to delegate fread > calls to your code. > > I recommend to use Python 3 instead. > > Regards, > Martin > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20150509/eb395cff/attachment.html>
- Previous message (by thread): [Python-Dev] Unicode literals in Python 2.7
- Next message (by thread): [Python-Dev] Unicode literals in Python 2.7
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list