MMS, encoded-string field

MMS, encoded-string field SearchSearch
Author Message
Jonatan
Unregistered guest
Posted on Monday, November 03, 2003 - 09:32 pm:   

I'm writing a PHP script to decode a MMS message, but I don't understand how the encoded-string fields work. Right now, I just try to decode the encoded-string fields as normal strings, but it seems like I get 0-2 characters in front of the real string, and I guess that is some codes for charsets isn't it?

Example output:

From: €+16505550000/TYPE=PLMN
Subject: „rubrik

If anyone could explain how that type of field works alitle bettar than the specification, I would be very happy!

Thanks.

/Jonatan Heyman
Vitaliy N. Kravchenko
New member
Username: Kvn

Post Number: 1
Registered: 10-2003
Posted on Tuesday, November 04, 2003 - 11:13 am:   

encoded string = string-len + string
see wap-209 for more details...
IMHO.
Jonatan
Unregistered guest
Posted on Saturday, November 08, 2003 - 12:45 pm:   

I have read the specification, but I didn't fully understand it, so I was hopeing that someone could explain it to me in a better way.

/Jonatan Heyman
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1135
Registered: 10-2002
Posted on Thursday, November 13, 2003 - 08:57 pm:   

Jonatan,

Can you post the binary that you are seeing ... along with your decoding of it. Then I will attempt to explain.

It's probably a character set reference ...

-bn
Jonatan
Unregistered guest
Posted on Sunday, November 16, 2003 - 01:41 am:   

Hi and thanks for the reply.

The FROM field is encoded like this:
89 16 80 2B 31 36 35 30 35 35 35 30 30 30 30 2F 54 59 50 45 3D 50 4C 4D 4E 00

If you decode the string from 80 to 4E, you get this string:
"€+16505550000/TYPE=PLMN"

The value I'm interested in starts from the fourth byte, and I don't know what to do with those other bytes.

Thanks.
/Jonatan Heyman
yanxh
New member
Username: Yanxh

Post Number: 2
Registered: 11-2003
Posted on Monday, November 17, 2003 - 01:31 am:   

89 : From
16 : Length
80 : Address-present-token
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1166
Registered: 10-2002
Posted on Monday, November 17, 2003 - 07:43 pm:   

Jonatan,

yanxh's reply is accurate. Please refer to Section 7.2.11 of the MMS Encapsulation specification (WAP-209), and it explains the encoding of the "From:" field.