string mainPath = Application.streamingAssetsPath + "/main.txt";
string mainJson = JsonMapper.ToJson(m_ListMainObj);
Regex reg = new Regex(@"(?i)\\[uU]([0-9a-f]{4})");
mainJson = reg.Replace(mainJson, delegate (Match m) { return ((char)Convert.ToInt32(m.Groups[1].Value, 16)).ToString(); });
using(FileStream fs = File.Open(mainPath, FileMode.OpenOrCreate))
{
// Putting some contents
Byte[] info = new UTF8Encoding(true).GetBytes(mainJson);
fs.Write(info, 0, info.Length);
}
Unity3d LitJson中文乱码问题
于 2023-05-31 10:25:00 首次发布