フォロー

C# は常にstringがUTF-16なのでそういう混乱起きなそう><
System.Console.WriteLine("𠮷野家".Length);
UTF-16のCharの数なので「4」

System.Console.WriteLine(new System.Globalization.StringInfo("𠮷野家").LengthInTextElements);
TextElementの数は「3」
System.Console.WriteLine(Encoding.UTF8.GetBytes("𠮷野家").Length);
UTF-8のバイト列の長さでは「10」

ログインして会話に参加
:realtek:

思考の /dev/null