I've done similar things in Japanese (EUC-JP) and what you'll have to do is convert the string(s) from the ISO-8859-1 encoding. What I've done is provide my own implementation of the ParameterParser interface that when a getString()/getStrings() method is invoked will do the following transformation:
----------------------------
public String getString(String name, String defaultValue)
{
String unconverted = parser.getString(name, defaultValue);
String converted = null;
try
{
if(unconverted != null)
{
byte[] bytes = unconverted.getBytes(DEFAULT_ENCODING);
converted = new String(bytes, charset);
}
}
catch(UnsupportedEncodingException e)
{
Log.error("UnsupportedEncodingException caught when converting: '"+unconverted+
"' from '"+DEFAULT_ENCODING+"' to '"+charset+"'", e);
// continue, but set bytes to unconverted value
converted = unconverted;
} return converted;
}
----------------------------DEFAULT_ENCODING is "8859_1", and the parser variable is the current ParameterParser.
Mail me back if you have any problems.
cheers, CP
Will Tao wrote:
Hello every turbine user:
I am using Turbine 2.20 to develop a Chinese website. And I am in trouble now.
In TR.properties file. I have set
------------------------------- services.VelocityService.input.encoding=GBK #services.VelocityService.input.encoding=GBK ##this line be commented,but even I add this line,same problem
locale.default.bundle=MyBundle locale.default.language=zh locale.default.country= locale.default.charset= GBK ------------------------------
Now ,when user do get request to the Servlet Container(Resin), they got the GBK charset page ,that's fine. But when I post data to the server(eg,post form) , all GBK charset became ??x?? I am really worried about that.
Any help will be appreciated!
Best Regards W,Tao
-- R E D S H E R I F F C.P. Lim - Software Engineer [EMAIL PROTECTED]
96-98 Market St +61 (3) 9606 4036 tel South Melbourne +61 (3) 9606 4001 fax Victoria 3205 +61 (413) 781 846 cell
This message and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this message in error please notify us immediately by return email or telephone +61 (2) 8204 5888, then delete this message. Any views expressed in this message are those of the individual sender and many not necessarily reflect the views of Red Sheriff.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
