我的代码:
StringReader tr = null;
TextAsset data = (TextAsset)Resources.Load("data.ext", typeof(TextAsset));
tr = new StringReader(data.text);
sTemp = tr.ReadLine();
Debug.Log(sTemp);
data.ext 文件:
00!%%%£r!%%%£122222230e0e01255
我的输出:
00!%%%r!%%%122222230e0e01255
如您所见,StringReader(或可能是 TextAsset)似乎不喜欢 £ 字符。我认为可能存在一些我不知道的奇怪的转义类型的字符,我查看了 .net 和 unity 文档,但我找不到任何解释或任何关于特殊字符的提及。
这个让我完全难住了。我在使用单声道.NET 的 Unity3D 中编译。我可能会使用官方的 .NET 编译器进行一些测试。
谢谢你的帮助。