日语的 Java 编码

发布于 2024-12-20 08:54:17 字数 239 浏览 3 评论 0原文

我们的软件有一个脚本可以创建不同语言的 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:

enter image description here

Anyone have any idea about what might be causing this? Could this problem be related to a change in Java?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

壹場煙雨 2024-12-27 08:54:17

通过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.

a√萤火虫的光℡ 2024-12-27 08:54:17

我建议检查以下两件事:

  1. 绝对确保 native2ascii 转换正确。您应该使用 -reverse 标志进行往返转换,并确保您的输入和输出同步。
  2. 仔细检查您使用的字体是否支持 Shift-JIS。对话框文本和按钮文本中出现的那些块和符号看起来像字符可能没问题,但字体可能不支持它们。

额外的警告:如果此应用程序打算在 Windows 上使用,那么您确实应该使用 MS932windows-31j 编码。 SJIS 适用于除十几个符号之外的所有符号,但事实证明这些符号(如全角波浪线)实际上在日本使用得相当频繁。

I would suggest checking these 2 things:

  1. Make absolutely sure that the 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.
  2. Double-check that your fonts used can support Shift-JIS. Those blocks and symbols that appear in the dialog text and button text look like the characters might be OK, but the fonts might not support them.

An additional word of caution: If this application is intended for use on Windows, then you really should be using the MS932 or windows-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.

烟酉 2024-12-27 08:54:17

我认为正确的方法是专门使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文