You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered: