为什么仅部分国家/地区捆绑包显示欧元符号?
Currency euro = Currency.getInstance("EUR");
String ireland = euro.getSymbol(new Locale("en", "IE"));
String germany = euro.getSymbol(Locale.GERMANY);
爱尔兰的价值是:“¤” 德国的值为:“€”
德国符合预期,而爱尔兰则不然。那么为什么呢?我的意思是这与虚拟机中的其他行为不一致。我的意思是,如果我要求一种货币,但我没有得到符号,因为我通常会得到“EUR”之类的符号。什么给?我必须在代码中对任何得到“¤”的地方进行修改,然后尝试获取另一个语言环境中表示的另一个符号?
有谁知道应该/不应该安装这样的国家捆绑包或者如何解决这个问题?
Currency euro = Currency.getInstance("EUR");
String ireland = euro.getSymbol(new Locale("en", "IE"));
String germany = euro.getSymbol(Locale.GERMANY);
The Value of ireland is: "¤"
The value of germany is: "€"
Germany is as expected, however the ireland one is not. So Why? I mean this is inconsistent with the rest of the behavior in the vm. I mean if I ask for a currency that I don't get a symbol for I usually get something like "EUR" as the symbol. What gives? I have to put a hack in my code for anywhere you get a "¤", then try to get another symbol as represented in another locale?
Does anyone know is such a country bundle should/shouldn't be installed or how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论