Tencent / MMKV

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
Other
17.1k stars 1.88k forks source link

ohos中json字符串末尾分号丢失 #1294

Closed chenqinggang001 closed 1 week ago

chenqinggang001 commented 2 months ago

复现demo

onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
    hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
    let appCtx = this.context.getApplicationContext();
    let mmkvRootDir = MMKV.initialize(appCtx);
    let mmkv = MMKV.defaultMMKV();

    let str: string = '{"courseId":39575,"name":"通识课测试2","type":4,"status":1,"limit":1819956082000,"needapprove":"0","lastModifyDate":1712821563000,"openCourse":1,"md5":"967cdcbd284197d68efb19ca9b27f06b"}';
    mmkv.encodeString('string', str);
    hilog.info(0x0000, 'testTag', '%{public}s', 'decodeString:' + mmkv.decodeString('string'));

  }

输出日志: 05-09 10:55:05.817 43921-43921 A00000/testTag pid-43921 I decodeString:{"courseId":39575,"name":"通识课测试2","type":4,"status":1,"limit":1819956082000,"needapprove":"0","lastModifyDate":1712821563000,"openCourse":1,"md5":"967cdcbd284197d68efb19ca9b27f06b"

chenqinggang001 commented 2 months ago

刚刚好这个json字符串会遇到这个问题,其他的json字符串正常,很奇怪

lingol commented 2 months ago

Noted. I will look at it later.

lingol commented 2 months ago

It's fixed in the dev branch.

lingol commented 2 months ago

It's fixed in v1.3.6-beta on OHPM.

xinle commented 1 month ago

It's fixed in v1.3.6-beta on OHPM.

为啥现在还不发布到正式版本?

fgh345 commented 2 weeks ago

同问 什么时候可以更新

lingol commented 1 week ago

It's fixed in v1.3.6.