Skip to content

Instantly share code, notes, and snippets.

@jamesmeneghello
Created March 10, 2015 15:16
Show Gist options
  • Select an option

  • Save jamesmeneghello/7bb6e9d685895e39e680 to your computer and use it in GitHub Desktop.

Select an option

Save jamesmeneghello/7bb6e9d685895e39e680 to your computer and use it in GitHub Desktop.
unicode_patch
Index: pynab/parts.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pynab/parts.py (revision 8f1d6e710d7bbfd60dc5c080a006594f972b43a0)
+++ pynab/parts.py (revision )
@@ -63,7 +63,7 @@
# leave off the comma
s.write('"' + part[item].replace('"', '\\"') + '"')
else:
- s.write('"' + str(part[item]).replace('"', '\\"') + '",')
+ s.write('"' + str(part[item].encode('utf-8', 'replace').decode()).replace('"', '\\"') + '",')
s.write("\n")
s.seek(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment