Comment 12 for bug 1172106

Revision history for this message
Sahdev Zala (spzala) wrote :

Thanks a lot, John! Yep, I tested it and the problem go away :-). It set's default encoding to utf-8.

Dolph/Brant, so I guess use of the .so file generated by using the files John has provided (his above comments) might be our best option. I have tested it is by copying the .so file under /opt/stack/keystone (directory that's in the python path) and then importing the module in the code.

I also tested two different things:
1. By manually declaring encoding which python understands well. For example, u'name \u540d\u5b57'.encode('utf-8'). But this might not be a great idea, as it requires declaring encoding every time you are using unicode. Also, this requires you to decode encoding if you are using the variable as a string somewhere else.

2. By modifying /usr/lib/python2.7/sitecustomize.py to make default encoding utf-8,
Which takes care of problem, but again I think this may not be a good option to handle programatically.