Convert simplified Chinese/UTF-8 string to traditional Chinese (Big5)

D

David

Hi, All,
I need to convert a simplified Chinese or UTF-8 string to a traditional
Chinese using C#. I found a very good link
(http://www.dotnet247.com/247reference/msgs/45/229725.aspx) which gave me
some suggestion. However, it was in VB.Net and it had compile problem even
if I included Microsoft.VisualBasic in the reference. Does anyone know a
similar solution for my problem? Thank you very much in advance.
 
M

Morten Wennevik

Hi David,

I'm not familiar with the VB methods mentioned in the article,
but you should be able to convert the strings just fine using Encodings
and byte arrays.

Encoding original = Encoding.UTF8;
Encoding target = Encoding.GetEncoding("Big5");

byte[] data = original.GetBytes(text);
string convertedString = target.GetString(data);
 

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

Top