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

  • Thread starter Thread starter David
  • Start date Start date
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.
 
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);
 
Back
Top