日语的 Java 编码
我们的软件有一个脚本可以创建不同语言的 JAR 文件,对于日语,我们在调用 native2asci 时使用编码 SJIS。上次尝试进行日语构建时,此方法有效,但现在似乎仅在某些情况下有效。例如,在以下对话框中,编码似乎仅在标题栏中有效:
任何人都知道可能是什么原因造成的?这个问题是否与 Java 的更改有关?
Our software has a script that creates different language JAR files, for Japanese we use the encoding SJIS in a call to native2asci. This worked last time a Japanese build was attempted but now seems to only work in certain contexts. For example in the following dialog the encoding seems to only work in the title bar:
Anyone have any idea about what might be causing this? Could this problem be related to a change in Java?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通过native2ascii到底传递了什么?只是为了确保,您使用的是 native2ascii -encoding Shift_JIS,对吗?您正在通过native2ascii 传递文本文件或源文件,对吗?
我唯一的另一个想法是,在文本转换为 \uXXXX 格式后,您用于显示对话框的字体可能不包含所有汉字和假名。显式设置字体,然后尝试一下。
What exactly do you pass through native2ascii? Just to make sure, you're using native2ascii -encoding Shift_JIS, right? And you're passing text files or source files through native2ascii, right?
My only other idea is that after the text has been converted to \uXXXX format, the font you're using to display the dialog may not have all the Kanji and Kana. Explicitly set a font, and try that.
我建议检查以下两件事:
native2ascii
转换正确。您应该使用-reverse
标志进行往返转换,并确保您的输入和输出同步。额外的警告:如果此应用程序打算在 Windows 上使用,那么您确实应该使用
MS932
或windows-31j
编码。SJIS
适用于除十几个符号之外的所有符号,但事实证明这些符号(如全角波浪线)实际上在日本使用得相当频繁。I would suggest checking these 2 things:
native2ascii
conversions are correct. You should do a round trip conversion with the-reverse
flag, and make sure that your input and output are in sync.An additional word of caution: If this application is intended for use on Windows, then you really should be using the
MS932
orwindows-31j
encoding.SJIS
will work for all but a dozen or so symbols, but it turns out these symbols (like the full-width tilde) are actually used quite frequently in Japan.我认为正确的方法是专门使用 UTF-8 或 UTF-16。汉字和片假名需要特别注意。
I think the right way to do this is to use UTF-8 or UTF-16 exclusively. Kanji and Katakana demand special attention.