You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by James Adams <se...@hotmail.com> on 2005/05/20 16:00:16 UTC

setLocale() Unicode UTF-8 not working

I'm trying to get Romanian characters working with Struts and its driving me 
crazy.

I want the user to be able to click the Romanian flag they to switch to that 
language if they wish.

The folloing code is in a class that extends DisplayActionClass and is called 
when flag is clicked.

....
Locale tLoc = new Locale("ro");        
setLocale(request, tLoc );

MessageResources ms = getResources();
String str = ms.getMessage(tLoc, "testmessage");
System.out.prinln(str);            //--NOT CORRECT SPECIAL CHARACTERS MANGLED
....

The message resources are set but the the trouble is the special Romanian 
character are not displayed correctly.
In struts-config.xml I've set the controller  to contentType="text/html; 
charset=UTF-16".  But the messages are incorrect as soon as I get the 
MessageResources object, as illustrated in the code above.

Is this a bug in Struts?  I've seen the same question answered a couple of 
times before but without answer.

thanks in advance

James


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org