Hi Matt,

you can find a solution in an older posting of Chuck Hill (http:// www.wodeveloper.com/omniLists/webobjects-dev/2003/September/ msg00455.html).
In short:

1. overwrite takeValuesFromRequest in your multipart form component:

public void takeValuesFromRequest(WORequest aRequest, WOContext aContext)
        {
aRequest.setDefaultFormValueEncoding ( _NSUtilities.UTF8StringEncoding );
                super.takeValuesFromRequest(aRequest, aContext);
        }

2. overwrite the createRequest method in Application

        public WORequest createRequest(String aMethod, String aURL,
                        String anHTTPVersion, NSDictionary someHeaders, NSData 
aContent,
                        NSDictionary someInfo)
        {
WORequest newRequest = super.createRequest(aMethod, aURL, anHTTPVersion,
                                someHeaders, aContent, someInfo);
newRequest.setDefaultFormValueEncoding (_NSUtilities.UTF8StringEncoding);
                return newRequest;
        }

he also used the following overwrite in Application:

        public WOResponse dispatchRequest(WORequest request)
        {
                WOResponse response = super.dispatchRequest(request);

                String contentType = response.headerForKey("content-type");
if ((contentType == null) || (contentType.toLowerCase().indexOf ("text/html") > -1))
                {
                        
response.setContentEncoding(_NSUtilities.UTF8StringEncoding);
response.setHeader("text/html; charset=UTF-8; encoding=UTF-8", "content-type");
                }
                return response;
        }

This should do it. It works fine in my projects.
For more detailed information, please refer to Chucks original post.

Regards,

Helmut

Am 16.01.2007 um 05:33 schrieb Matt Kime:

I'm trying to add a WOFileUpload to UTF-8 form and WO is complaining
that the enctype needs to be "multipart/form-data" and I have it set
to "multipart/form-data; charset=utf-8".

anybody know how to fix this?

thanks,
matt
_______________________________________________
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/ helmut.schottmueller%40mac.com

This email sent to [EMAIL PROTECTED]

 _______________________________________________
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