8000 errors with unicode in outgoing SMS messages · Issue #39 · twilio/twilio-python · GitHub
[go: up one dir, main page]

Skip to content
errors with unicode in outgoing SMS messages #39
Closed
@jklundell

Description

@jklundell

Sending an SMS text via client.sms.messages.create(to=to_phone, from_=from_phone, body=body), if body is a unicode string and has a non-ascii character, we eventually get:

Exception Type: UnicodeEncodeError
Exception Value:
'ascii' codec can't encode character u'\u2014' in position 71: ordinal not in range(128)
Exception Location: /usr/lib/python2.7/urllib.py in urlencode, line 1282

Moreover, if I encode body to utf-8 before the call, the call succeeds, but the recipient (iPhone 4 running iOS 5.0.1) shows ? in place of the character in question (an em-dash in my test). iOS ordinarily handles such characters OK, at least phone-to-phone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0