fastjson2 icon indicating copy to clipboard operation
fastjson2 copied to clipboard

[BUG]特定环境下put数字导致乱码

Open icdada opened this issue 1 year ago • 4 comments

问题描述

简要描述您碰到的问题。

环境信息

请填写以下信息:

  • OS信息: [e.g.:Linux http-in-cloud 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:29 UTC 2023 s390x s390x s390x GNU/Linux]
  • JDK信息: [e.g.:Openjdk 17]
  • 版本信息:[e.g.:Fastjson2 2.0.42]

重现步骤

如何操作可以重现该问题:

去ibm的https://linuxone.cloud.marist.edu/#/login 申请服务器 写一个使用fastjson2的jar(换了好几个版本,基本都是乱码) 带依赖打包jar 使用java -jar 打包的jar名称

如图所示部分数字出现了乱码,且在win下运行时完全正常 在换用org.json时输出完全正常 """ src/main/resources true <finalName>Httpserver</finalName> <artifactId>maven-compiler-plugin</artifactId> 3.11.0 17 17 <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> 3.6.0 src/main/assembly/assembly.xml <mainClass>org.example.Main</mainClass> make-assembly package single <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> 3.3.1 copy-resources validate copy-resources <outputDirectory>${basedir}/target/classes</outputDirectory> src/main/resources true """

//可在此输入示例代码
JSONObject json = JSONObject.parseObject("{}");
        json.put("text2",1);
        json.put("text",0);
        System.out.printf(json +"\n");

期待的正确结果

对您期望发生的结果进行清晰简洁的描述。 正确的输出数字

相关日志输出

请复制并粘贴任何相关的日志输出。

附加信息

如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。

icdada avatar Nov 24 '23 15:11 icdada

Uploading 屏幕截图 2023-11-24 231926.png…

icdada avatar Nov 24 '23 15:11 icdada

你这图片嘎了

oooopl avatar Nov 25 '23 03:11 oooopl

------------------ 原始邮件 ------------------ 发件人: "Zhang Zhi @.>; 发送时间: 2023年11月25日(星期六) 中午11:30 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [alibaba/fastjson2] [BUG]特定环境下put数字导致乱码 (Issue #2051)

你这图片嘎了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

icdada avatar Nov 25 '23 12:11 icdada

JDK是什么版本?

wenshao avatar Nov 26 '23 01:11 wenshao