I attempted to deserialize class with multibyte name with utf8json.
I expected that it will be properly deserialized, but it did not happen.
sample script
using System;
using UnityEngine;
using Utf8Json;
public class multibytetest : MonoBehaviour {
[Serializable]
public class 漢字クラス {
public string 亜;
public string 伊宇江;
public string 尾華;
public string 機;
}
[SerializeField]
public 漢字クラス multibyte;
// Use this for initialization
void Start () {
var json = @"{""亜"":""a"",""伊宇江"":""b"",""尾華"":""c"",""機"":""d""}";
multibyte = JsonSerializer.Deserialize<漢字クラス>(json);
}
}
Result
It is considered that the processing of the second field is not processed normally.
The second field key has 9 bytes, but the AutomataDictionary.GetKey method is called only once.
With my expectation, I think that rest is called 8 for the first time, and rest is called 1 for the second time.
If deserialize with Dictionary type, it will work.
I attempted to deserialize class with multibyte name with utf8json. I expected that it will be properly deserialized, but it did not happen.
sample script
Result
It is considered that the processing of the second field is not processed normally. The second field key has 9 bytes, but the AutomataDictionary.GetKey method is called only once. With my expectation, I think that rest is called 8 for the first time, and rest is called 1 for the second time.
If deserialize with Dictionary type, it will work.
Thank you.