我有一个返回 JSON 的 API,它实际上使用默认编码返回它(我相信它是 UTF-8),但日语和阿拉伯字符显示为 ???或者一些垃圾
我的问题是:有没有一种简单的方法来显示日文字符?我尝试将页面编码设置为 UTF-8,但它不起作用。有人可以建议解决方案吗?
最佳答案
如果某处没有错误,则应该可以使用 UTF-8。请参阅:
这里是Hiragana日语字母 UTF-8 encoding page 。
所以,我认为您犯了一个错误,或者您的 API 没有完成其工作。
编辑:
正如达菲莫在对您的问题的评论中指出的那样:
Either the JSON isn't encoded or the display isn't interpreting them properly. Just two spots to check. Either or both could be wrong
关于java - HttpServletResponse编码问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12839057/