Re: i18n problem with Struts2 - getting weird
Yeah. But the issue was that i have not defined the needed: <%...@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 05.04.2010 um 13:58 schrieb Alex Rodriguez Lopez: > Do you have your struts.custom.i18n.resources property correctly assigned to > your bundle(s)? > > Em 05-04-2010 11:27, Marc Logemann escreveu: >> Hi, >> >> imagine the following jsp (saved in UTF-8 encoding): >> >> -- snipp --- >> >> <%@ taglib prefix="s" uri="/struts-tags" %> >> >> >> >> >> Hauptmenü >> >> >> >> >> >> >> -- END snipp --- >> >> Now i have a resource bundle like that: >> >> menu.mainmenu=Hauptmen\u00fc >> >> Inside its the german u with 2 dots on top. >> >> Now i run the following action: >> >> -- snipp --- >> >> public class TestStruts2Action extends ActionSupport { >> >> String foo; >> >> public String execute() { >> foo = getText("menu.mainmenu"); >> >> return Action.SUCCESS; >> } >> >> public String getFoo() { >> return foo; >> } >> } >> >> -- END snipp --- >> >> When i run this in the browser, i am getting 3 different things. >> >> * The hardcoded "Hauptmenü" in the JSP will be displayed correcty. This >> means that the browser has correctly read the stream with a UTF-8 encoder. >> * The string gets out of the bundle via wil be broken. Instead >> of an Entity or the raw UTF-8 character, i am getting "ef bf bd" as last >> character, means unknown character. >> * the third way of exposing attribute "foo" will result in the word >> "Hauptmenü" (with the correct HTML entity). Remeber, it comes from the >> same bundle as you can see in the action. >> >> So something is wrong with tag but what. I tried solving this one >> for about 4 hours without any luck. When switching the browser encoding to >> ISO-8859-1, the works but then of course variant 1 doesnt work >> because i hardcoded the "umlaut" to the JSP and i definitely need that >> running because thats the natural way to do. >> >> Thanks for hints. >> >> --- >> regards >> Marc Logemann >> http://www.logemann.org >> http://www.logentis.de >> >> >> >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: i18n problem with Struts2 - getting weird
Do you have your struts.custom.i18n.resources property correctly assigned to your bundle(s)? Em 05-04-2010 11:27, Marc Logemann escreveu: Hi, imagine the following jsp (saved in UTF-8 encoding): -- snipp --- <%@ taglib prefix="s" uri="/struts-tags" %> Hauptmenü -- END snipp --- Now i have a resource bundle like that: menu.mainmenu=Hauptmen\u00fc Inside its the german u with 2 dots on top. Now i run the following action: -- snipp --- public class TestStruts2Action extends ActionSupport { String foo; public String execute() { foo = getText("menu.mainmenu"); return Action.SUCCESS; } public String getFoo() { return foo; } } -- END snipp --- When i run this in the browser, i am getting 3 different things. * The hardcoded "Hauptmenü" in the JSP will be displayed correcty. This means that the browser has correctly read the stream with a UTF-8 encoder. * The string gets out of the bundle via wil be broken. Instead of an Entity or the raw UTF-8 character, i am getting "ef bf bd" as last character, means unknown character. * the third way of exposing attribute "foo" will result in the word "Hauptmenü" (with the correct HTML entity). Remeber, it comes from the same bundle as you can see in the action. So something is wrong with tag but what. I tried solving this one for about 4 hours without any luck. When switching the browser encoding to ISO-8859-1, the works but then of course variant 1 doesnt work because i hardcoded the "umlaut" to the JSP and i definitely need that running because thats the natural way to do. Thanks for hints. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
i18n problem with Struts2 - getting weird
Hi, imagine the following jsp (saved in UTF-8 encoding): -- snipp --- <%@ taglib prefix="s" uri="/struts-tags" %> Hauptmenü -- END snipp --- Now i have a resource bundle like that: menu.mainmenu=Hauptmen\u00fc Inside its the german u with 2 dots on top. Now i run the following action: -- snipp --- public class TestStruts2Action extends ActionSupport { String foo; public String execute() { foo = getText("menu.mainmenu"); return Action.SUCCESS; } public String getFoo() { return foo; } } -- END snipp --- When i run this in the browser, i am getting 3 different things. * The hardcoded "Hauptmenü" in the JSP will be displayed correcty. This means that the browser has correctly read the stream with a UTF-8 encoder. * The string gets out of the bundle via wil be broken. Instead of an Entity or the raw UTF-8 character, i am getting "ef bf bd" as last character, means unknown character. * the third way of exposing attribute "foo" will result in the word "Hauptmenü" (with the correct HTML entity). Remeber, it comes from the same bundle as you can see in the action. So something is wrong with tag but what. I tried solving this one for about 4 hours without any luck. When switching the browser encoding to ISO-8859-1, the works but then of course variant 1 doesnt work because i hardcoded the "umlaut" to the JSP and i definitely need that running because thats the natural way to do. Thanks for hints. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org