Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2004

Tip: Looking for answers? Try searching our database.

get 7-bit from character (GSM 03.38)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DraguVaso - 07 Oct 2004 15:49 GMT
Hi,

I need to a way to find the 7-bit code from a character. Or a function like
Asc() but that will give the character code based on the 7-bit ecoding (I
needf it fo convert text to GSM 03.38).

For exemple:
in ASCII (what I don't need!):
"?"        ->     233 (= Asc("?")        ->   11101001 (8 bits)

in 7-bit GSM 03.38 (what I need!!):
"?"        ->    5                                ->    0000101 (7 bits)

Does anybody knows how to get this?

Thanks a lot in advance,

Pieter
Jon Skeet [C# MVP] - 07 Oct 2004 15:57 GMT
> I need to a way to find the 7-bit code from a character. Or a function like
> Asc() but that will give the character code based on the 7-bit ecoding (I
[quoted text clipped - 3 lines]
> in ASCII (what I don't need!):
> "é"        ->     233 (= Asc("é")        ->   11101001 (8 bits)

No, that's not ASCII. There are no accents in ASCII.

> in 7-bit GSM 03.38 (what I need!!):
> "é"        ->    5                                ->    0000101 (7 bits)
>
> Does anybody knows how to get this?

It looks like you just need a mapping table - the reverse of the map
listed at

http://www.smsitaly.com/Download/ETSI_GSM_03.38.pdf

It shouldn't be too hard, especially given that all the valid
characters are in the first 256 values of unicode. Just have a byte
array with 256 values, where anything over 0x7f indicates that the
value is missing. For each character, check that the unicode value is
in the range 0-0xff, then find the byte value in the array. If it's
< 0x80, that's the value you want. If it's not, there's no such
character in GSM 03.38.

I suggest you write it as an Encoding, as you can then plug it into
your serial port code very easily.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.