Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can someone link me to where python uses UTF-16? It was my understanding it defaulted to UTF-8.

http://www.python.org/dev/peps/pep-3120/



That PEP only refers to the encoding of the source (code) file, not to the encoding on how strings are stored in Python.

Edit: Your question might be answered at SO: http://stackoverflow.com/questions/1838170/what-is-internal-...


> It was my understanding it defaulted to UTF-8.

For external IO, internally it's in UTF-16 (actually UCS-2, mostly unaware of surrogates) or in UCS-4 (via a compile-time switch).

See http://docs.python.org/c-api/unicode.html#Py_UNICODE for the Py_UNICODE API.


sorry for the quastion as the reply, i would also ask for some info about the unicode issues in jython, as i lack experience with all python stuff. does it have problems or everything is transparent?


check PEP-261




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: