是什么在编码方面UTF8 / UTF16和Base64编码的区别 [英] What's the difference between UTF8/UTF16 and Base64 in terms of encoding
问题描述
在。 C#
我们可以使用下面的类来实现编码:
We can use below class to do encoding:
System.Text.Encoding.UTF8
System.Text.Encoding.UTF16
System.Text.Encoding.ASCII
System.Text.Encoding.UTF8 System.Text.Encoding.UTF16 System.Text.Encoding.ASCII
为什么没有System.Text.Encoding.Base64?
Why there is no System.Text.Encoding.Base64?
我们只能用Convert.From(要)Base64String方法,有什么特殊的base64的?
We can only use Convert.From(To)Base64String method, what's special of base64?
我可以说Base64是相同的编码方法UTF8?或UTF8都是Base64之一吗?
Can I say base64 is the same encoding method as UTF8? or UTF8 is one of base64?
推荐答案
UTF-8 和 UTF-16 的方法来连接code单向code字符串到字节序列。
UTF-8 and UTF-16 are methods to encode Unicode strings to byte sequences.
请参阅:绝对最低每一个软件开发人员绝对,积极必须了解的Uni code和性格集(没有借口!)
的Base64 是EN $ C $一个方法C的字节序列为一个字符串。
Base64 is a method to encode a byte sequence to a string.
那么,这些被广泛不同的概念,不应混淆。
So, these are widely different concepts and should not be confused.
东西要记住:
-
不会再$ P $的每一个字节序列psents在UTF-8或UTF-16的统一code字符串连接codeD。
Not every byte sequence represents an Unicode string encoded in UTF-8 or UTF-16.
不是每个统一code字符串重新presents一个字节序列连接为Base64 codeD。
Not every Unicode string represents a byte sequence encoded in Base64.
这篇关于是什么在编码方面UTF8 / UTF16和Base64编码的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!