Hello Matt,
this has been discussed a couple times in the mailing list, the summary is:
1-You need to make sure the page has a correct UTF-8 header
------------
in Application.java
public void appendToResponse(WOResponse response, WOContext wocontext) {
super.appendToResponse(response, wocontext);
// This must be done after the page generation to override the default header created by WO during the page generation.
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;
}
------------

2-You need to make sur the form will be received in UTF-8
------------
in Session.java
public void takeValuesFromRequest(WORequest aRequest, WOContext aContext){
aRequest.setDefaultFormValueEncoding(_NSUtilities.UTF8StringEncoding);
super.takeValuesFromRequest(aRequest, aContext);
}
------------

3-You need to make sure the page that contains the form declares itself in UTF-8
------------
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
------------

4-You need to make sure the database is UTF-8, either by having something in your my.cnf file (for newly created database)
------------
[mysqld]
default-character-set=utf8
character-set-server = utf8

[mysql]
default-character-set=utf8
------------
or by making sure it is set appropriatly

5-Use the following connection dictionary (even if the unicode/utf parts are not necessary as it should already been discussing using UTF-8)
------------
useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
------------

6-Remember that blob doesn't have a character encoding, so you shouldn't store a string in a blob but rather use mediumtext.

I think you've got everything. If you still have some issue, you should be checking how to convert the text encoding on existing field in the database as they were probably not UTF-8 at the beginning...maybe try to dump the database, drop it recreate it 'making sure it's UTF-8 thanks to the my.cnf parameters).

Xavier



I'm having some trouble implementing UTF8 with webobjects. I've tried
very hard to dot my i's and cross my t's in this process but I'm
apparently missing something.

The problem doesn't seem to occur on smaller varchar fields. It only
occurs in text fields. (is this leading me astray?) Using CocoaMySQL
I've verified that UTF8 data is being properly stored in this text
field. It seems that WO is having a hard time submitting and
retrieving it as utf8.  I've set the following additional keys in my
JDBC connection which should make a utf8 connection.

useUnicode=true
characterEncoding=latin5

Is there a way to verify the connection character set? The pages are
definitely being created in utf8.

Any ideas? I'm obviously very confused.

thanks,
matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to