理论问题:
假设有一个来源只知道如何传输ASCII
字符。(0..127)
假设有一个端点接收这些 chars 。
端点可以将这些字符解码为 utf8 吗?
ascii chars
...
...
|
|
V
read as utf ?
像这样的伪代码:
var txt="אבג";
var _bytes=Encoding.ASCII.GetBytes(txt); <= it wont recognize [א] here
...transmit...
var myUtfString=Encoding.UTF8.GetString(getBytesFromWire(); <= some magic has to be done here