小编gav*_*ask的帖子

欧元符号未在适当的文件中显示正确

我正在阅读一个包含欧元符号的属性文件.当它在屏幕上打印时看起来完全不同.我比较了来自props文件的字符串,并使用equals方法声明另一个带有相同文本的字符串,这是假的.Pls可以有人帮助我.

properities file
your purchase order is €

string text="your purchase order is €";

on comparing the above strings it fails.

************************
public String getProperty(String arg0) {
        Properties prop = new Properties();
        InputStream input = null;


            try {
                input = new FileInputStream("C:/text.properties");

            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            try {

                prop.load(input);

            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

        return prop.getProperty(arg0);

    }
Run Code Online (Sandbox Code Playgroud)

java character-encoding java-ee properties-file

1
推荐指数
1
解决办法
1159
查看次数