C#中没有UTF

编程入门 行业动态 更新时间:2024-10-27 09:34:13
C#中没有UTF-32 big-endian?(No UTF-32 big-endian in C#?)

在C#中, Encoding.UTF32是UTF-32的小端, Encoding.BigEndianUnicode是UTF-16的大端, Encoding.Unicode是UTF-16的小端。 但我找不到任何用于UTF-32的big-endian。

我正在开发一个简单的文本查看器,并不认为有许多以UTF-32 big-endian编码的文档,但我也想为此做好准备,以防万一。

C#不支持UTF32 big-endian吗?

BTW Java支持它。

In C#, Encoding.UTF32 is UTF-32 little-endian, Encoding.BigEndianUnicode is UTF-16 big-endian, Encoding.Unicode is UTF-16 little-endian. But I can't find any for UTF-32 big-endian.

I'm developing a simple textviewer and don't think there are many documents encoded in UTF-32 big-endian but I want to prepare for that too, just in case.

Doesn't C# support UTF32 big-endian?

BTW Java supports it.

最满意答案

它确实支持UTF-32上的大端。 只需使用重载的构造函数自己创建编码即可:

Encoding e = new UTF32Encoding(true /*bigEndian*/, true /*byteOrderMark*/);

在编码上预定义为static的Encoding不是详尽的列表。 您可以创建更多更多的其他编码。

It does support big endian on UTF-32. Just create the encoding yourself using the overloaded constructor:

Encoding e = new UTF32Encoding(true /*bigEndian*/, true /*byteOrderMark*/);

The encodings predefined as static on Encoding aren't an exhaustive list. You can create much and much more other encodings.

更多推荐

本文发布于:2023-07-31 15:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1345293.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:UTF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!