Tuesday, October 10, 2006

Default python encoding to unicode

In file
vim /usr/lib/python2.4/site.py
Comment out line 352 and add 353

352 #encoding = "ascii" # Default value set by _PyUnicode_Init()
353 encoding = "utf8"

to check

ipython
import sys
sys.getdefaultencoding()
Out[2]: 'utf8'

No comments: