-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unicode codec error #16
Comments
Thanks for reporting. This is most likely a bug.... Erwin |
Confirm that change fixes the issue - it accepts unicode strings now, and they go into OTRS as expected. diff --git a/otrs/objects.py b/otrs/objects.py
index b75bef4..fd7fb8f 100644
--- a/otrs/objects.py
+++ b/otrs/objects.py
@@ -100,7 +100,7 @@ class OTRSObject(object):
e = etree.Element(k)
if isinstance(e, str): # True
v = v.encode('utf-8')
- e.text = str(v)
+ e.text = unicode(v)
root.append(e)
return root |
ewsterrenburg
added a commit
that referenced
this issue
Jun 15, 2016
Allow unicode entries without codec error, fix #16
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using python-otrs to submit an article where the text contains unicode (\u210c in this case), the following error occurs:
Apologies for screenshot instead of text
Looking in objects.py around line 103, I don't really understand what's going on here.
The
# True
comment here suggests that v is always being encoded as utf-8, but then str(v) is applied where an encoding error is being raised.Not sure whether this is a bug, or there is a certain way in which python-otrs is should be passed unicode content?
Thanks,
The text was updated successfully, but these errors were encountered: