NetBeans中的重音 [英] Accent � in NetBeans

查看:81
本文介绍了NetBeans中的重音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在NetBeans的命令行中使用以下西班牙语字符(使用Java):

I'm trying to use the following Spanish characters in the command line in NetBeans (using Java):

aáeéiíoóuúAÁeÉIÍOÓUÚÑñ

a á e é i í o ó u ú A Á E É I Í O Ó U Ú Ñ ñ

但是,当我输入此行时,会得到以下结果:

However when I enter this line, I got the following result:

a e o u A E I O U

a � e � i � o � u � A � E � I � O � U � � �

我正在使用的代码是:

public class SpanishChars {

public static void main (String[] args)
{
    Scanner sc = new Scanner(System.in);

    System.out.println("Enter some spanish chars next: ");
    String spanishLine = sc.nextLine();

    System.out.println("Spanish char entered are next: " + spanishLine);
}

我知道这是一个NetBeans问题,因为当我在Eclipse IDE中运行相同的程序时,结果就很好.

I know it's a NetBeans problem because when I run same program in Eclipse IDE, results are just fine.

有人知道如何解决吗?

推荐答案

我在Netbeans 8中玩游戏,我发现当我将编码更改为ISO-8859-9并运行代码时,结果将是

I was playing in Netbeans 8, and I found out when I change encoding to ISO-8859-9 and run the code, the out come is going to be

Enter some spanish chars next: 
a á e é i í o ó u ú A Á E É I Í O Ó U Ú Ñ ñ
Spanish char entered are next: a á e é i í o ó u ú A Á E É I Í O Ó U Ú Ñ ñ

注意:要在Netbenas 8 IDE中更改编码,请执行以下操作: 单击您的节点项目->右键单击->单击属性->单击源->更改编码部分

Note: To change encoding inside Netbenas 8 IDE: click on your node project-> right click -> click on properites-> click on source -> change encoding section

这篇关于NetBeans中的重音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆