Fixing unicode support for PreferencesHelper#41
Conversation
There was a problem hiding this comment.
Man, that's very unreliable.
Can we just make ConfigObj(file_or_filename, encoding='utf-8') instead? What breaks when we do that?
There was a problem hiding this comment.
that's a great suggestion. I'll look into that as a better solution.
PreferenceHelper based on that change
|
@rkern changing only ConfigObj is not enough as the Preferences class convert all the object to str internally. Either we need to change the way the preference sets the object by not converting them to str and letting ConfigObj doing the conversion job or we need to do the proper conversion from str to unicode with a decode/encode. What do you think? Changing the way the preference work by not converting the object to str is not hard. I am just slightly worried on the impact on external users. |
conversion and letting that done by ConfigObj
impact on the other tests (that should be fixed ...)
|
@rkern I've updated the comments and the tests to do a full load/save cycle. |
|
Fixes #35 |
|
LGTM! Thanks! |
Fixing unicode support for PreferencesHelper
The PreferencesHelper don't work properly when getting/storing unicode strings with non-ascii caracters. This PR intends to fix the issue.