-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I added a dependency on the library kitchen (everything but the sink 😄).
Python has a general problem with writing Unicode out to buffers. If you write out Unicode that contains non-ascii, it is not happy. Kitchen provides several common code snippets that are useful in may scenarios. One of these is code to handle Unicode/Byte strings. I am using the to_bytes to convert Unicode into python type str before writing them out to the buffer. This avoids exceptions being thrown.
For more information on kitchen and unicode/str problem see:
http://pythonhosted.org/kitchen/
http://pythonhosted.org/kitchen/unicode-frustrations.html
Thanks to @dtg3 for pointing this library out to me. I use it quite a lot now.