韩语未在Apache NetBeans中显示

huangapple go评论140阅读模式
英文:

Korean does not appear in Apache Netbeans

问题

我已经尝试了各种方法来修复这个问题,但是我并没有成功,我真的不知道该怎么办。

查看效果

我尝试了将编码改为utf-8,但没有成功,
还尝试了更改配置文件,但仍然没有成功。
一切都运行正常,但是当我输入任何韩文字符时,只显示一个方框,而不显示字符本身。

英文:

i am pretty much tried all method to fix this but i didn't succeeded i dont really konw what to do
how its look

i tried endcoding to utf-8 and its didnt work
and chance the config file and stil didn't work
all work fine but when i put any korean char its just showing the square box
and not showing the char himself.

答案1

得分: 1

3/15/20: Edited to provide instructions on obtaining an appropriate font for Korean characters.
3/16/20: Edited to provide instructions on downloading, installing and using a Korean font collection.


The square boxes are probably being displayed because you are not using a font capable of rendering Korean characters, so just use one that does. One such font which NetBeans provides is Arial Unicode MS so try that:

  1. To set that font for your edit windows containing your source code:
  • Select Tools > Options > Fonts & Colors
  • On the Syntax tab set Font to Arial Unicode MS.
  • Click the Apply button, then the OK button.
  • To verify that the change allows Korean characters to be rendered, copy and paste this text into the main() method of some trivial Java application: System.out.println("안녕하세요 세상!");. If you have set the font to Arial Unicode MS it should be displayed correctly.
  1. To also set that font for your Output window, containing the println() output:
  • Select Tools > Options > Miscellaneous
  • On the Output tab set Font to Arial Unicode MS.
  • Click the Apply button, then the OK button.

When you run your application you should see the Korean characters correctly rendered in the edit window and the output window:

If this doesn't resolve your issue, please update your question to provide more specific details of your problem, including specifying the font(s) that you are using in the window(s) rendering Korean characters as square boxes.


If Arial Unicode MS is not available, select an alternative available font which is capable of rendering Korean characters. To do this on Windows:

  • Open a Command Prompt window and enter chcp 949 to change the code page to 949.
  • Click the command prompt icon in the top left of the window, then select Properties from the context menu.
  • Click the Font tab. The list in the Font panel will be restricted to those available fonts which support code page 949.
  • In NetBeans set the font to one of those fonts which was available in the Command Prompt window for code page 949.
  • If you need to add a font to NetBeans to support Korean characters, see this SO question: Newly installed fonts do not appear in Netbeans.

Another alternative approach is:

  • Download a Korean font collection to a local file named Gungsuh-Font.zip. The collection contain four fonts: Gungsuh, GungsuhChe, Batang and BatangChe.
  • Make that font collection available in edit windows in NetBeans: Tools > Options > Fonts & Colors, then click Import....
  • Make that font collection available in the Output window in NetBeans: Tools > Options > Miscellaneous, click the Output tab, then click Import....
  • Set the font in the edit windows and/or the Output window to any of the newly installed fonts as previously described above for Arial Unicode MS font.
  • Here's sample output, with the edit window using the fixed width GungsuhChe font, and the Output window using Batang font:

To use the fonts outside of NetBeans you need to install them on Windows:

  • In Windows File Explorer locate and unzip the downloaded font file (Gungsuh-Font.zip).
  • Select the unzipped file gungsuh.ttc, right click and select Install from the context menu to install the font collection to C:\Windows\Fonts.

You can then access the fonts outside of NetBeans. For example, here is a screen shot showing the Java application being run from the command line, with the font in the Command Prompt window first having been set to BatangChe:

Note from the screen shot that you must first set the code page to 949 (using chcp 949) before running the application, or the Korean characters will not be rendered correctly.

英文:

3/15/20: Edited to provide instructions on obtaining an appropriate font for Korean characters.
3/16/20: Edited to provide instructions on downloading, installing and using a Korean font collection.


The square boxes are probably being displayed because you are not using a font capable of rendering Korean characters, so just use one that does. One such font which NetBeans provides is Arial Unicode MS so try that:

  1. To set that font for your edit windows containing your source code:
  • Select Tools > Options > Fonts & Colors
  • On the Syntax tab set Font to Arial Unicode MS.
  • Click the Apply button, then the OK button.
  • To verify that the change allows Korean characters to be rendered, copy and paste this text into the main() method of some trivial Java application: System.out.println("안녕하세요 세상!");. If you have set the font to Arial Unicode MS it should be displayed correctly.
  1. To also set that font for your Output window, containing the println() output:
  • Select Tools > Options > Miscellaneous
  • On the Output tab set Font to Arial Unicode MS.
  • Click the Apply button, then the OK button.

When you run your application you should see the Korean characters correctly rendered in the edit window and the output window:
韩语未在Apache NetBeans中显示

If this doesn't resolve your issue, please update your question to provide more specific details of your problem, including specifying the font(s) that your are using in the window(s) rendering Korean characters as square boxes.


If Arial Unicode MS is not available, select an alternative available font which is capable of rendering Korean characters. To do this on Windows:

  • Open a Command Prompt window and enter chcp 949 to change the code page to 949.
  • Click the command prompt icon in the top left of the window, then select Properties from the context menu.
  • Click the Font tab. The list in the Font panel will be restricted to those available fonts which support code page 949.
  • In NetBeans set the font to one of those fonts which was available in the Command Prompt window for code page 949.
  • If you need to add a font to NetBeans to support Korean characters, see this SO question: Newly installed fonts do not appear in Netbeans.

Another alternative approach is:

  • Download a Korean font collection to a local file named Gungsuh-Font.zip. The collection contain four fonts: Gungsuh, GungsuhChe, Batang and BatangChe.

  • Make that font collection available in edit windows in NetBeans: Tools > Options > Fonts & Colors, then click Import....

  • Make that font collection available in the Output window in NetBeans : Tools > Options > Miscellaneous, click the Ouput tab, then click Import....

  • Set the font in the edit windows and/or the Output window to any of the newly installed fonts as previously described above for Arial Unicode MS font.

  • Here's sample output, with the edit window using the fixed width GungsuhChe font, and the Output window using Batang font:

    韩语未在Apache NetBeans中显示

To use the fonts outside of NetBeans you need to install them on Windows:

  • In Windows File Explorer locate and unzip the downloaded font file (Gungsuh-Font.zip).
  • Select the unzipped file gungsuh.ttc, right click and select Install from the context menu to install the font collection to C:\Windows\Fonts.

You can then access the fonts outside of NetBeans. For example, here is a screen shot showing the Java application being run from the command line, with the font in the Command Prompt window first having been set to BatangChe:

韩语未在Apache NetBeans中显示

Note from the screen shot that you must first set the code page to 949 (using chcp 949) before running the application, or the Korean characters will not be rendered correctly.

huangapple
  • 本文由 发表于 2020年3月15日 07:07:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/60688153.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定