Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Message should be sent as latin1 as specified by API documentation. U…

…nicode can only be used if excplicitly specfified as SMS encoding.
  • Loading branch information...
commit ae20af2d0b5974cfba11d50d14e8b2a4ed333130 1 parent a9b298c
Martin Eggen authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  pswinpy/http_sender.py
  2. +1 −1  pswinpy/request.py
2  pswinpy/http_sender.py
View
@@ -18,7 +18,7 @@ def send(self, request):
if Mode.debug:
webservice.set_debuglevel(3)
webservice.putrequest("POST", self.url)
- webservice.putheader("Content-type", "text/xml; charset=\"UTF-8\"")
+ webservice.putheader("Content-type", "text/xml; charset=\"latin1\"")
webservice.putheader("Content-length", "%d" % len(xml))
webservice.endheaders()
webservice.send(xml)
2  pswinpy/request.py
View
@@ -9,7 +9,7 @@ def __init__(self, username, password):
def addMessage(self, to, text, sender='', TTL='', tariff='', serviceCode='', deliveryTime=''):
self.messages.append({'receiver': to,
- 'text': text,
+ 'text': text.decode("utf8").encode("latin1"),
'sender': sender,
'TTL': TTL,
'tariff': tariff,
Please sign in to comment.
Something went wrong with that request. Please try again.