问题描述
我最近了解到的SQL Server 2005不支持UTF8:
I have recently learned that sql server 2005 does not support UTF8:
http://stackoverflow.com/questions/3336992/utf8-problem-sql-server
我相信它支持UCS-2,但并寻找一种方式来转换UTF8到UCS-2没有的,如果可能的信息丢失。是吗?
I believe 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!
基督教
PS:C#preferred( - :
PS: C# preferred (-:
推荐答案
它看起来像你在UTF-8的文本文件的连接codeD,并要重新连接code到UCS-2 。 的StreamReader
和的StreamWriter
支持自动编码;你在它们的构造函数提供一个编码
对象。
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.
您应该能够:
- 构造一个
的StreamReader
与编码。 UTF8
- 构造一个
的StreamWriter
,提供Encoding.Uni code
- 阅读来自读者线,并将其写入作家
这篇关于变换UT8到UCS-2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!