开发者

transform UT8 to UCS-2

开发者 https://www.devze.com 2023-01-09 05:13 出处:网络
I have recently learned that sql server 2005 does not support UTF8: UTF8 problem sql server I belie开发者_Go百科ve it supports UCS-2 though and look for a way to transform UTF8 to UCS-2 without loss

I have recently learned that sql server 2005 does not support UTF8:

UTF8 problem sql server

I belie开发者_Go百科ve it supports UCS-2 though and look for a way to transform UTF8 to UCS-2 without loss of information if possible. Is it?

Any feedback would be very much welcome. Thanks!

Christian

PS: C# preferred (-:


It looks like you have a text file encoded in UTF-8 and you want to re-encode it to UCS-2. StreamReader and StreamWriter support encoding automatically; you supply an Encoding object in their constructors.

You should be able to:

  1. Construct a StreamReader with Encoding.UTF8
  2. Construct a StreamWriter with Encoding.Unicode
  3. Read lines from the reader and write them to the writer
0

精彩评论

暂无评论...
验证码 换一张
取 消