hi all can anyone help me in converting the data from unicode(16bit) to 7bit ascii in c++ language thanx
You can map unicode chars 0..127 to the ASCII set. For the other chars there is no 7 bit ASCII equivalent. What do you want to do with those?
There is nothing in the C++ language itself for handling such conversions. You have to use RTL/API functions instead. For instance, if your app is running on the Windows platform, it can use the Win32 API WideCharToMultiByte() function. If you want something more portable, look at GNU's iconv library.
Or, you can simply perform the conversion manually. Unicode UTF-16 is very easy to decode by hand, and from there values 0-127 are the ASCII values.
You want to convert double-byte unicode characters into utf7 which will give you characters that can be represented in the ascii character set (and avoid being garbled by antique systems that cant handle characters with the highest bit set). Note that this will split up a multibyte character into several characters (if read as ascii).
Example code can be found at ibiblio.org (from a quick google search). Unknown license.
To pack 16-bit data to 7-bit you could use Boost.Serialization Library