Convert Unicode string to EBCDIC

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Could someone pls tell me how to convert a Unicode string to EBCDIC
Intenational.
Is WideCharToMultiByte API is the only way? how do we use it.
Can the Encoding class method GetEncoding(CodePage) be used to achieve the
same result.

Thanks,

- Srinivas
 
Srinivas said:
Hi,

Could someone pls tell me how to convert a Unicode string to EBCDIC
Intenational.
Is WideCharToMultiByte API is the only way? how do we use it.
Can the Encoding class method GetEncoding(CodePage) be used to
achieve the same result.

System.Text.Encoding should do the trick:

// Let's try state-of-the-art EBCDIC 1047 ;-)
Encoding enc = Encoding.GetEncoding(20924);
byte[] bytes = enc.GetBytes("500 €");

All available Win32 code pages and their identifiers are listed here:
http://tinyurl.com/cjwm

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top