• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UTF8 and ContentEncoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTF8 and ContentEncoding


  • Subject: Re: UTF8 and ContentEncoding
  • From: David Avendasora <email@hidden>
  • Date: Wed, 11 Nov 2009 08:05:27 -0500

Hi David,

1) I noticed in some places you are using "UTF8" and in others "UTF-8".

These are not the same. It should always be "UTF-8"

I know there is some Apple documentation out there from 2003 that shows UTF8, but I believe that that is actually wrong, at least with 5.4.

2) If you are using Wonder make sure you have this set in your properties:

	er.extensions.ERXApplication.DefaultEncoding=UTF-8

3) Make sure your Workspace Preferences are set to UTF-8:

PNG image


4) You can also override the encoding on a component-by-component basis, which is the last thing I'd try if you've done everything else. In your MyComponent.woo file (create it in the MyComponent.wo directory if it doesn't exist) put the following:


{
	"WebObjects Release" = "WebObjects 5.0";
	encoding = "UTF-8";
}

I hope these help!

Dave

On Nov 11, 2009, at 7:33 AM, David Griffith wrote:

Also, another thing to note, if I just type a € on the WOComponent page, it also displays as a '?' when the page loads. It seems like it's not applying the UTF-8 encoding.

Regards,
David.

On Nov 11, 2009, at 1:30 PM, David Griffith wrote:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

On Nov 11, 2009, at 1:23 PM, Gino Pacitti wrote:

What about the encoding on the actual HTML page? Whats that set to?

Regards

Gino

On 11 Nov 2009, at 12:17, David Griffith wrote:

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");
 }

Which I did. It helped to a certain extent. It seemed to fix the problem with the form values, which now displayed correctly, but the '?' still appears where the value is displayed with WOString. Then I found another suggestion:

Put this in Application class:

public WOResponse dispatchRequest(WORequest aRequest) {
aRequest.setContentEncoding("UTF-8");
WOResponse aResponse = super.dispatchRequest(aRequest);
aResponse.setContentEncoding("UTF-8");
return aResponse;

Doing this solved the problem of the '?' but reverted the form values to display as €.

No matter what I do, there doesn't seem to be a way to get them both to display correctly. Any ideas?

Regards,
David.
_______________________________________________
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

_______________________________________________ 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

_______________________________________________
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

_______________________________________________
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



David Avendasora Senior Software Engineer K12, Inc.

*****
WebObjects Documentation Wiki : http://wiki.objectstyle.org/confluence/display/WO/
*****
WebObjects API: http://developer.apple.com/legacy/mac/library/documentation/MacOSXServer/Reference/WO54_Reference/index.html
*****

 _______________________________________________
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

  • Follow-Ups:
    • Re: UTF8 and ContentEncoding
      • From: David Griffith <email@hidden>
References: 
 >UTF8 and ContentEncoding (From: David Griffith <email@hidden>)
 >Re: UTF8 and ContentEncoding (From: Gino Pacitti <email@hidden>)
 >Re: UTF8 and ContentEncoding (From: David Griffith <email@hidden>)
 >Re: UTF8 and ContentEncoding (From: David Griffith <email@hidden>)

  • Prev by Date: Re: UTF8 and ContentEncoding
  • Next by Date: Re: Numbers Only in WOTextField
  • Previous by thread: Re: UTF8 and ContentEncoding
  • Next by thread: Re: UTF8 and ContentEncoding
  • Index(es):
    • Date
    • Thread