当前位置: 首页 > 工具软件 > [ini4j] > 使用案例 >

Java ini4j 输出unicode而不输出中文

冀啸
2023-12-01
        File file = new File("/dav.authz");
        Ini ini = new Ini(file);

        Config config = ini.getConfig();
        config.setEscape(false);


        ini.add("test:/中文", "test", "rw");
        ini.store(file);

使用java中的ini4j 写配置文件,会出现中文变成unicode的情况,解决办法:

获取config对象,将Config属性设置为false的escape将禁止转义非ASCII字符

 类似资料: