我正在阅读一个包含欧元符号的属性文件.当它在屏幕上打印时看起来完全不同.我比较了来自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)