Ticket #1591 (closed defect: fixed)
SMS not decoded properly, gets truncated
| Reported by: | stiell | Owned by: | openmoko-kernel |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | kernel | Version: | 2007.2 |
| Severity: | major | Keywords: | HasPatch |
| Cc: | Jeffrey.Ratcliffe@… | Blocked By: | |
| Blocking: | Estimated Completion (week): | ||
| HasPatchForReview: | PatchReviewResult: | ||
| Reproducible: |
Description
Regular, 7-bit encoded SMS messages are not decoded properly when received. Non-ASCII text like æøå shows up as boxes containing hexadecimal values of the characters, GSM-encoded, in the Messages program.
Messages containing the "@" character (encoded as 0x00 in the GSM alphabet) are truncated right before "@" and don't seem to be recoverable.
These problems also appear in /home/root/.evolution/memos/local/system/journal.ics.
The messages seem to follow the alphabet at http://www.dreamfabric.com/sms/default_alphabet.html.
I'm using the 2008-07-06 build of the 2007.2 image, later upgraded via opkg.
Attachments
Change History
comment:2 Changed 5 years ago by JJR
- Cc Jeffrey.Ratcliffe@… added
ä is shown as {, ü as ~, also, as posted above, in /home/root/.evolution/memos/local/system/journal.ics
This renders SMS in languages with such characters (e.g. German), rather useless.
comment:3 Changed 5 years ago by stiell
It looks like the problem is in moko-sms.c, function on_incoming_sms. It assumes ALPHABET_DEFAULT means "7-bit ASCII message" instead of the GSM 7 bit default alphabet. Although I'm not a C developer, I would try to make a patch, but I don't have the development environment set up.
comment:4 Changed 5 years ago by stiell
I've got the toolchain set up and am in progress of fixing this bug! The "@" problem is fixed, and I'm now going to make it translate the other characters.
I'm using Unicode's maping document on the GSM 7-bit default alphabet:
http://unicode.org/Public/MAPPINGS/ETSI/GSM0338.TXT
I'll submit a patch once I'm done.
comment:5 Changed 5 years ago by zecke
Once you do please set "HasPatch?" in the keywords so we are seeing your patch and can act on it (http://wiki.openmoko.org/wiki/Bug_Filing_Policy)
Changed 5 years ago by stiell
- Attachment libgsmd-sms-unpacking-7bit-return-dest-length.patch added
Return the length of dest (which moko-sms needs to know) instead of src->length (already known).
Changed 5 years ago by stiell
- Attachment openmoko-dialer2-sms-7bit-code-properly.patch added
Encode and decode 7-bit messages properly.
comment:6 Changed 5 years ago by stiell
These patches fix both encoding and decoding.
There are some additional fixes:
- A potential buffer overflow on receiving (old line 292, new line 297)
- Not being able to send more than 140 UTF-8 bytes even in 7-bit (old line 798, new line 1011)
I'm not able to set "HasPatch" in the keywords, presumably because of [admin-trac https://admin-trac.openmoko.org/trac/ticket/1504 #1504].
comment:8 Changed 5 years ago by erin_yueh
- Status changed from new to in_testing
patch committed to revision 4618 and 4619. Thanks a lot for your contributions!
comment:10 Changed 5 years ago by erin_yueh
are you testing with 2007.02 version? it's GTK applications, not free runner image.
comment:11 Changed 5 years ago by erin_yueh
- Status changed from in_testing to closed
- Resolution set to fixed
i marked it as fixed. after applied this patch, it can display non-ASCII texts correctly!
