Android使用mmkv取缓存后,对象里面的某个字段变成了 【��】
Android使用mmkv取缓存后,对象里面的某个字段变成了 【��】,这个是什么原因呢?
### Tasks
Without logs, it's impossible to know for sure. Please provide the necessary info as the issue template requires, otherwise this issue will be ignored and closed.
取缓存调用:
public <T extends Parcelable> T getParcelable(String name, String key,Class<T> tClass) { MMKV mmkv = getMMKV(name); try { T t = mmkv.decodeParcelable(key, tClass); return t; }catch (Throwable e){ mmkv.remove(key); } return null; }
获取到的结果: {"employeeName":"", "employeeId":"��", "goodsCover":true, "remark":"", ……}
其中 employeeId字段内容成为��了。
In that case, serialize your object into data and deserialize back to see if that employeeId is correct.
正常使用没问题,现在就是不知道什么情况下会出现这个情况。 我这边目前也复现不了
It's highly likely that it contains non Utf-8 characters.
Closed due to inactive.