JSp displays foreign currencies as junk
I am trying to display foriegn currencies in my jsp using formatnumber tag from apache fmt tag-lib, it displays junk char data. i can confirm that in controller 'the dynamic currency symbol value' being displayed correctly when I print out on console and I explicitly set response object encoding to UTF-8 and jsp page encoding and charset to UTF-8 as well. Setting the locale wont help as the transaction are in foriegn currencies and any transaction can be viewed on any part of the world.
Seems like there is a bug with formatnumber tag , but not sure about any alternat开发者_如何学Cives for that. mail-archives.apache.org/mod_mbox/tomcat-taglibs-user/200308.mbox/%3C000001c36bc5$4ee81db0$0100a8c0@pentium3%3E I checked this EURO and yen .
I pasted the part of code of my jsp http://pastebin.com/eZAKKeJ9. I tried printing out browser to make sure what's being pass to tag, so its junk line 545 tells and line 564 tell the formatnumber being passed with currency. and handler http://pastebin.com/H21fdbZm . Checked the browser to make sure it had default changed to UTF-8. Any help is appreciated. edit: spam doesnt allow me to post more than 2 links.
From your code:
currencySymbol="${txnFormBean.originalCurrencySymbol}"
This problem can occur when the bean property actually returned a non-UTF-8 character. You need to fix it in the source where this character originated. Is it a Java file? Ensure that file is saved as UTF-8. Is it a properties file? Ensure that you use an unicode escape sequence. Is it a database entry? Ensure that the table uses UTF-8. Etc.
精彩评论