Sent: Wednesday, November 11, 2009 5:17 AM
Subject: UTF8 and ContentEncoding
Hi all,
I have the following situation:
A database with all tables specified to default to UTF8 encoding.
Adaptor URL containing useUnicode=true&setContentEncoding=UTF8
A record in one table that holds the € currency symbol.
I am loading a WOComponent page to edit values etc., using a form.
Everything was fine and one day all the € symbols started appearing as '?'. Clearly something changed somewhere on the server but I don't know what. Anyway, the €msymbols that are appearing this way are displayed by using a WOString. The value it displays is from defaultCountry which is a variable of type COUNTRY loaded from the database and stored in the Session class.
€ symbols that were entered on the form, when added to a display group for example, would appear as â¬.
I've had a look around and what I found was this suggestion:
Put this in Application class:
public void takeValuesFromRequest(WORequest r, WOContext c) {
r.setDefaultFormValueEncoding("UTF8");
super.takeValuesFromRequest(r,c);
}
public void appendToResponse(WOResponse r, WOContext c) {
r.setContentEncoding("UTF8");
super.appendToResponse(r,c);
r.setHeader("text/html;charset=utf-8", "Content-Type");
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden