zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
88 stars 46 forks source link

Text encoding seems to break international characters on incoming SMS #103

Closed stoneburner closed 1 year ago

stoneburner commented 2 years ago

Hi, i noticed that at least some characters seems to have broken in a weird way:

i received a text message with the content that should be:

"Freundliche Grüße, Ihr Drei Service-Team"

but it is

Freundliche G��e, Ihr Drei Service-Team

if i look at the hex values of the broken characters - every one is as these three bytes 0xEF 0xBF 0xBD (even if they are different characters) - so i cannot even fix this by manually replacing the characters.

Is there any way to get the "raw" content of the message so i can parse it manually?

Edit:

i found this node library that parses the sms correctly:

https://github.com/tbehrsin/tpdu

mejuliver commented 2 years ago

any update on this issue?

Apollon77 commented 2 years ago

Please provide a debug log that shows the issue

stoneburner commented 2 years ago

Hi, those are the raw messages: 07913476060166106404817600000071605011132280A005000366020198E9B2B82C072DEB6E7299054AA2E56590B3DE6E97E5A07B5D4E2E83C8E5F09A9EB6A7CB72BA0B546D839268791924AD9BDDF576BB2C07DDCB697A598E4EBB41FA3AC85DA7EBCB6E16881D2697DDA069BA0C4AA2E5A0639D8E0E8BCB6E90384DA79741EE721D14AE9B5DA027DA5D0605EB6676985C779F41F7B49C0C4AA2E56590B3DE6E97E5

079134760601661064048176000000716050111322807F050003660202406937C8066ABEDD617AD90D3A97D9FCF9184D07D5DD6450122D071DEB7474585C7683EC65B979CF66D35D2061390D32CAC3E7B21B742FBBC96537689A2E83E6E9311A147683EAEE79590E9A96E5F6F4B80CA296C36D50DD4D2FCB412BDACC76BBD960B098ED7683B900

when decoded it should result into this string:

Lieber Kunde, Ihre Nummer wurde deaktiviert. Um Ihre Rufnummer weiterhin zu nutzen, laden Sie Ihr Guthaben bitte neu auf. Ohne Aufladung wird Ihre Nummer in 6 Monaten gelöscht und Ihr Guthaben verfällt. Bei Fragen wenden Sie sich an unser Service Team unter +4367760016770.

Thanks for looking into this.

Btw, when i send mesages with international characters from my phone, they work fine.