Encoding of Python 2 string literals

anatoly techtonik techtonik at gmail.com
Wed Jul 22 06:17:59 EDT 2015


Hi,

Is there a way to know encoding of string (bytes) literal
defined in source file? For example, given that source:

    # -*- coding: utf-8 -*-
    from library import Entry
    Entry("текст")

Is there any way for Entry() constructor to know that
string "текст" passed into it is the utf-8 string?

I need to better prepare SCons for Python 3 migration.

Please, CC.
-- 
anatoly t.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150722/9153d110/attachment.html>


More information about the Python-list mailing list