I am having trouble with character encoding in a WO application that encodes all pages in UTF-8.

As instructed by "Practical WebObjects" I have added an Application appendToResponse that sets the header to UTF-8. I've also added a meta-tag for content-type.

Just to be paranoid, I added the UTF-8 setting code to appendToResponse in Session and my component as well.

This works in an internally consistent way-- that is, I can enter some Chinese text in a form field, store the text in the Application, and display it in the page, and all looks OK, without having to select the encoding in the browser. It also works if I select UTF-8 in the browser. This works for Safari, Firefox, Camino and Netscape, (but not for MSIE 5.2.3, not that this is a serious problem). This is all on Mac OS X. Also, when I fetch the page using cURL from the command line, the content displays correctly.

I can even save the text in a VARCHAR field in FrontBase, fetch it back and display it in the page, and it looks OK.

However, it is not stored as UTF-8. When displayed in FrontBaseManager or when browsing data in EOModeler, it looks like rubbish.

One suspicious thing is that when I display the request from the WOContext, it says the form encoding is ISO8859_1.


Another problem is that in another WO project that uses Project Wonder, the same setup does NOT work, even without the database. If I enter Chinese text in a from field, it is stored in the Application as rubbish an is displayed as rubbish.


I don't know enough about encoding to see if any particular string is correctly encoded, other than by looking at it on the screen.

I have tried er.extensions.ERXRequest.BrowserFormValueEncodingOverrideEnabled=false a nd =true

Any ideas? I don't really care about the database format, as long as it is consistent across all the pages and displays as it is entered in a text field.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to