gpt4 book ai didi

java - windowbuilder xwt 设计 MalformedByteSequenceException : Invalid byte of UTF-8 sequence

转载 作者:太空宇宙 更新时间:2023-11-04 08:03:59 25 4
gpt4 key购买 nike

问题是:当我们尝试在 .xwt 文件的 xml 属性中使用俄语字符(例如标签文本)时,WindowBuilder 设计 View 崩溃并出现错误:

com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException:3 字节 UTF-8 序列的字节 2 无效。

看来 xml 解析器因文件编码而崩溃。

最佳答案

问题已经解决了。 WindowBuilder 将 IOUtils.toInputStream(xwt_file_content) 传递给 XWTParser。 XWTParser 需要 UTF8 编码流,但您的 Eclipse IDE 使用默认系统编码。将 JVM 参数 -Dfile.encoding=UTF8 添加到 eclipse.ini。

关于java - windowbuilder xwt 设计 MalformedByteSequenceException : Invalid byte of UTF-8 sequence,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12384932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com