You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
因为浏览器按照RFC7159 I-JSON标准,新的javascript API (IE,FF,chrome均是) JSON.parse要求key必定需要双引号,但是中文不一定需要UTF code,于是我们全局使用SerializerFeature.WriteNonStringKeyAsString,但这个时候enum key变成{""C"":"D",""E"":"A"}了。请注意Gson默认输出已经是I-JSON规范,因此兼容所有浏览器。
另外,因为JSON不存在所谓的数字key,即便是旧的json,key的语义也是String,因此parse(object, Map.class)的默认不应该返回数字的key,Gson此处仍然正确。
希望可以搞个1.3版本来按I-JSON标准处理?
The text was updated successfully, but these errors were encountered: