规范化 Unicode 字符串以获得其规范表示
例如,"à"
(一个 Unicode 字符)也可以编码为 "\u0300a"
(两个 Unicode 字符,即组合重音符号 (U+0300)后面跟着 a),.NET 中是否有功能可以规范化字符串,以便后者转换为前者?
我相信前者被认为是规范的表示。我的特殊问题是,我见过某些浏览器无法正确显示后者的情况,但这在其他情况下也可能很有用。
Given that for example "à"
(one Unicode character) can also be encoded as "\u0300a"
(two Unicode characters, i.e. a combining grave accent (U+0300) followed by an a), is there functionality in .NET to normalize a string so that the latter is converted into the former?
I believe the former is deemed the canonical representation. My particular issue is that I've seen cases where the latter isn't displayed correctly by some browsers, but this could be useful in other scenarios too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚找到了,呵呵! String.Normalize
Just found it, duh! String.Normalize