tags:

views:

112

answers:

2

hello all can anyone help me in finding the code for decompress the unicode to 7bit ascii thanx

A: 

If encoded with utf-8, it is the same for both ascii and unicode as ascii is a subset of unicode. See the example in RFC 2044

Yacoby
A: 

A simple example below:

        try
        {
            System.IO.TextWriter writeFile = new StreamWriter("c:\\textwriter.txt",false,Encoding.UTF7);
            writeFile.WriteLine("example text here");
            writeFile.Flush();
            writeFile.Close();
            writeFile = null;
        }
        catch (IOException ex)
        {
            MessageBox.Show(ex.ToString());
        }
Xander
This allows you to write to UTF-7, the string can be in any encoding i believe
Xander
NOTE: If there are some characters in the string that is not supppored by UTF-7, it will be lost
Xander
Looks rather more Java than C++ to me.
Kylotan
@Kylotan, I was thinking it looked more like C#, but same point: OP wanted a C++ answer.
mrduclaw
@Xander: UTF-7 is a Unicode encoding, like the UTF-16 used by .Net. Now there are characters outside of Unicode (Klingon for instance) but you can't lose those by converting between different Unicode representations.
MSalters