The background is this: I'm using ClickaTell with a rented number to receive incoming SMS text messages. I'm writing some code to piece back together a multipart/concatenated SMS. To do this I need to extract information from the "User Data Header", or UDH. The format of a UDH is described here: http://en.wikipedia.org/wiki/Concatenated_SMS
Now, Clickatell sometimes send me a UDH that looks like this:
050003fe0303
And that's fine - that looks like a UDH. All good. But sometimes they send me a UDH that looks like this:
303530303033666530333033
Note that this is an alternative encoding of the same UDH as the first example above.
What I need to do is work out why these two encodings are equivalent. The second encoding is almost certainly made up of pairs of numbers. So:
30 = 0
33 = 3
35 = 5
what I don't understand is why the "3" prefix changes to a "6". It looks like this happens after we get to "8". I've managed to work out that 66 = f, 65 = e and 63 = c, so I'm GUESSING that the code is:
30 = 0
31 = 1
...
38 = 8
60 = 9
61 = a
...
66 = f
Can anyone confirm this encoding? Is it something you've seen before? Does anyone know why the 3 changes to a 6?
Yours curiously...