See update below.
I used to have a Nokia phone, and backed up SMS messages using Nokia's PC Suite software. However, the messages were saved as .vmg files, which were encoded in unicode. Here's an example of how to decode a single .vmg file to a text file using C#. Converting the .vmg files to simple text files makes it a lot more convenient to read the messages later on. Of course, this isn't the only way to decode the files, and can be implemented with other languages.
1 private void DecodeVMG()
3 FileInfo finfo = new FileInfo("SMSmessage.vmg");
4 FileStream stream = new FileStream(finfo.FullName,
5 FileMode.Open, FileAccess.Read);
6 BinaryReader br = new BinaryReader(stream);
7 byte data = br.ReadBytes((int)finfo.Length);
8 string decodedstring =
10 using (StreamWriter writer
11 = new StreamWriter("DecodedMessage.txt"))
Below is a sample output.
This is a test Message!
UPDATE (June 28, 2008): I noticed a large number of visits for this page, and I’m wondering if anyone will be interested if I created a simple program to do this conversion. I’ll be glad to hear your thoughts. Just leave a comment. Thanks!
Tags: .NET, C#, Code, Encoding, Nokia, SMS, Unicode, Windows