Hello My site is working good with Cyrillic
I add this to Application:
public void appendToResponse(WOResponse response, WOContext wocontext) { super.appendToResponse(response, wocontext); if (_NSUtilities.UTF8StringEncoding.equals(response.contentEncoding())) response.setHeader("text/html; charset=UTF-8","Content-Type"); }
public WOResponse createResponseInContext(WOContext wocontext) { WOResponse woresponse = super.createResponseInContext(wocontext); woresponse.setContentEncoding(_NSUtilities.UTF8StringEncoding); return woresponse; }
This to session (I assume, something like this may be added to Application instead):
public void takeValuesFromRequest(WORequest aRequest, WOContext aContext) { aRequest.setDefaultFormValueEncoding(_NSUtilities.UTF8StringEncoding); super.takeValuesFromRequest(aRequest, aContext); }
And if you use DirectActions but not componentActions you have to add this to DirectActions:
public WOActionResults performActionNamed(String anActionName) { WOResponse result = super.performActionNamed(anActionName).generateResponse(); if (_NSUtilities.UTF8StringEncoding.equals(result.contentEncoding())) result.setHeader("text/html; charset=UTF-8","Content-Type"); return result; }
Also today I realized that I had to add "unicode=true&characterEncoding=UTF-8" to jdbc connect string though I wrote it is not necessary previously. By the way. Are you using correct jdbc adaptor?
Consider reading
Regards Gennady
On 18.08.2005, at 21:02, Jim Kuo wrote: Hi,Have you ever managed to get cyrillic to display in your site when you have UTF-8 characters in both database and the .wo files ?
I tried your solution, however the problem remains, if i omit the line
aResponse.setContentEncoding(_NSUtilities.UTF8StringEncoding);
from appendToResponse(), then the UTF-8 characters in the database get inserted and retrieved properly, but the UTF-8 characters embedded in the .wo files would appear as ???.
If i include the setContentEncoding line, then it appears if WO is trying to encode the existing UTF-8 data again, so this time the UTF-8 characters in the .wo files appear fine, but the data from the database appears as rubbish.
Jim On 18 Aug 2005, at 09:57, Kushnir Gennady wrote: the problem is with database encoding.consider reading thread "ConnectorJ and MySQL4.1" here is my solution posted there. there were others
Begin forwarded message:
Date: 10.08.2005 Subject: Re: ConnectorJ and MySQL4.1 (my solution)
I solved the problem just setting database character set to utf 8. it works fine with cyrillic even with connector 3.1.10 and without "unicode=true&characterEncoding=UTF-8". I'm happy :)
Gennady _______________________________________________ Do not post admin requests to the list. They will be ignored.
|