PC Review


Reply
Thread Tools Rate Thread

tis-620 to UTF8

 
 
=?Utf-8?B?amRjaGFyYm9ubmVhdQ==?=
Guest
Posts: n/a
 
      12th Jun 2007
I have a bunch of text written in Thai using TIS-620 encoding. I need to
convert it to UTF8 in my C# program. (I need code, or a callable library, not
a program.) Can you point me to example code to do this?

Thanks

 
Reply With Quote
 
 
 
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      12th Jun 2007
jdcharbonneau <(E-Mail Removed)> wrote:
> I have a bunch of text written in Thai using TIS-620 encoding. I need to
> convert it to UTF8 in my C# program. (I need code, or a callable library, not
> a program.) Can you point me to example code to do this?


TIS-620 is code page 874 (according to a bit of research) so you can
do:

byte[] tis620 = ...; // However you obtain those bytes

byte[] utf8 = Encoding.Convert (Encoding.GetEncoding(874),
Encoding.UTF8,
tis620);

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
=?Utf-8?B?amRjaGFyYm9ubmVhdQ==?=
Guest
Posts: n/a
 
      13th Jun 2007
Thanks!

"Jon Skeet [C# MVP]" wrote:

> jdcharbonneau <(E-Mail Removed)> wrote:
> > I have a bunch of text written in Thai using TIS-620 encoding. I need to
> > convert it to UTF8 in my C# program. (I need code, or a callable library, not
> > a program.) Can you point me to example code to do this?

>
> TIS-620 is code page 874 (according to a bit of research) so you can
> do:
>
> byte[] tis620 = ...; // However you obtain those bytes
>
> byte[] utf8 = Encoding.Convert (Encoding.GetEncoding(874),
> Encoding.UTF8,
> tis620);
>
> --
> Jon Skeet - <(E-Mail Removed)>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
txt-file is UTF8 or DOS. Joergen Bondesen Microsoft Excel Programming 8 12th Dec 2006 12:13 AM
vti_encoding:SR|utf8-nl =?Utf-8?B?TG9zdGZpbGVz?= Microsoft Word Document Management 4 4th Jan 2006 02:40 AM
UTF8 Question Nuno Magalhaes Microsoft C# .NET 2 30th Nov 2005 10:03 PM
UTF8 =?Utf-8?B?amVhbg==?= Windows XP New Users 1 29th Jun 2004 11:45 PM
UTF8 Amman Microsoft C# .NET 1 11th Dec 2003 10:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:07 PM.