jookies / jasmin

Jasmin - Open source SMS gateway
http://jasminsms.com
Other
1.01k stars 550 forks source link

Problem with encoding latin_1 #1106

Closed hadpro24 closed 1 year ago

hadpro24 commented 1 year ago

I have an encoding problem with jasmin, it adds commas in my message. here is the message I sent with the encoding (lating_1) encoding=3: When I send this message :

The error message "It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path" is indicating that Django's collectstatic command is encountering multiple files with the same destination path, and it is only collecting the first one it encounters.

I received that (they added comma indestination like destin,ation):

The error message "It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path" is indicating that Django's collectstatic command is encountering multiple files with the same destin,ation path, and it is only collecting the first one it encounters.

here is the code I use:

if SMSCounter.count(message)['encoding'] == 'UTF16':
    coding = 8
    message = message.encode('utf-16-be')
else:
    coding = 3
    message = message.encode('latin_1')
URL = 'XXXXXXXXXXXX/send'
payload = {
    'to': contact,
    'content': message,
    'from': '',
    'username': 'XXXX',
    'password': 'XXXX',
    'dlr': 'yes',
    'priority': 3,
    'dlr-url': 'XXXX',
    'dlr-level': 2,
    'dlr-method': 'POST',
    'coding': coding
}
http = urllib3.PoolManager()
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
response = http.request('POST', URL, body=urllib3.request.urlencode(payload), headers=headers)

Could someone help me understand where the problem comes from?

hadpro24 commented 1 year ago

@farirat Can you help me