On Sep 25, 2008, at 5:33 PM, Peter Vandoros wrote:

Hi Chuck,

On 26/09/2008, at 4:02 AM, Chuck Hill wrote:
(b) using UTF-8 as the page encoding, by

public class Application extends WOApplication {
...
 // ensure UTF-8 is actually used anywhere
 static public void updateResponseForUTF8(WOResponse rr) {
     rr.setContentEncoding(_NSUtilities.UTF8StringEncoding);

Unless you are using 5.4.2 or 5.4.3 (can't recall which now, 5.4.3 I think), _NSUtilities.UTF8StringEncoding returns the incorrect "UTF8" string, no hyphen. This can cause the request to think that the encoding has changed ( ! "UTF8".equals("UTF-8")) and it then discards the form values. But with the "multipart/form-data" it then can't recreate them so you get null. My bug notes say, "The hours this has cost me..."

Try using  rr.setContentEncoding("UTF-8");


Is this an issue with WO 5.2 and 5.3 or just 5.4?

There are two issues. One, if the encoding gets changed and you are using "multipart/form-data", the form values are lost. Two, UTF-8 is more "proper" than UTF8 and in WO 5.4.x, WO has been moving toward this as a standard.


Will changing usages of UTF8 to UTF-8 cause any issues with WO 5.2 or 5.3? I ask because we have been using _NSUtilities.UTF8StringEncoding in a few places for years now and have not come across this issue, maybe we've just been lucky. I don't want to change anything unless I am certain that this will definitely not break anything. Obviously we are going to test any changes we make, I just wanted your opinion on this.


I don't think there is a practical difference, both seem to work for the time being. UTF-8 is more correct. You just have to be certain to be consistent and just use one of them.

Chuck


--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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