#41 Support for non-ascii encoding in .k?b files

open
pyke (39)
5
2011-02-02
2011-02-02
No

Would it be possible to include support for python encoding declarations? Perhaps one could use the encoding line as described in PEP-0263 [1] to declare encoding in one of .k?b files and this would be copied to the compiled python files? Or then just default to the basic file encoding on the platform.

Currently (v1.1.1) putting a scandinavian 'ä' into a krb-file results in a SyntaxError during knowledge_engine.engine creation:

SyntaxError: Non-ASCII character '\xc3' in file compiled_krb/sale_rules_plans.py on line 7, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (sale_rules_plans.py, line 7)

it works if I manually add #encoding-utf-8 to the first line of the compiled py-file in question.

[1] - http://www.python.org/peps/pep-0263.html

Discussion