转换为UCS2 [英] Convert to UCS2

查看:405
本文介绍了转换为UCS2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有Vb.net(或C#)的所有功能都可连接codeS在UCS2字符串?

Is there any function in Vb.net (or C#) that encodes a string in UCS2?

感谢

推荐答案

没有,.NET支持,从的 System.Text.Encoding 。您可以平凡获得UTF-16 ,但不UCS-2。但是,如果你第一次得到在输入字符串摆脱所有代理对,则UTF-16的的UCS-2。但没有内置的编码,做了你。

No, .NET supports the full Unicode range for strings and many encodings that derive from System.Text.Encoding. You can trivially get UTF-16, but not UCS-2. However, if you first get rid of all surrogate pairs in the input string, then UTF-16 is UCS-2. But there's no built-in encoding that does that for you.

这篇关于转换为UCS2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆