I am having an issue with Struts2 converting Unicode data from getter methods on my action classes to ascii (each multi-byte Unicode character turns into multiple single-byte ascii characters) when displayed on my web page. IE:
"‡" turns into "â€¡"
The web application I am developing edits Marc Record data (book data which can be any language) and is forced as either UTF-8 or ISO-8859-1. This works fine in struts1 however it seems that i18n support in struts2 gives me this issue. Bascially, I need is to disable this automatic native2ascii conversion on my getter methods (seems like what is happening). I tried adding a char encoding filter on my web.xml but the filter didn't seem to do anything.
Thanks for the quick response, however I think you are missing what I am saying...
tagValueUnicode contains "‡" in java (the character, not the escaped html Unicode value) however when struts2 generates the <input type="text"> above and injects the value, it is "â€¡" again, the characters not the html escaped values.
I had to use the html escaped equivalents to display on the forum since it seems there is a character-set issue on the forum as well for posting Unicode data...
posted 6 years ago
I tracked down the issue, wasn't a struts2 issue after all... I am using HTML Tidy filter on my pages and seems it was doing the conversion on me, once I removed the filter from my web.xml, all characters are displaying correctly now...I will need to track down configuration option to disable that "feature".
Alas, poor Yorick, he knew this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop