• 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: Text encoding issue using string file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text encoding issue using string file


  • Subject: Re: Text encoding issue using string file
  • From: Jean-François Veillette <email@hidden>
  • Date: Sun, 13 Mar 2005 12:41:35 -0500

String files (.strings) are loaded by the WOResourceManager.
There is no way to tell it to load the file using a specific encoding. WORM try to guess the encoding in the file, but for all 8bytes encoding (mac roman, utf8, win-latin), it is too similar to correctly guess. So it revert to the default value, which I think is win-latin-1(?). To be sure of the encoding, encode .strings files in utf-16, WORM will be able to guess the encoding, and you will get good results.


I remember reading something about it somewhere in the apple doc.

- jfv

Le 05-03-13, à 11:48, Dev WO a écrit :

Hi all,
even on a sunday I still have questions;)
I've setup a small application using a .strings file to handle some localization strings. Actually there's only one language, but I the issue is already there:
Here's what I have (I followed the Practical WO book example):
- {"WebObjects Release" = "WebObjects 5.0"; encoding = NSUTF8StringEncoding; } in the .woo file
- <meta http-equiv="content-type" content="text/html;charset=UTF-8"> in the HTML
-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");
} in the Application.java file
-public WOResponse createResponseInContext(WOContext wocontext) {
WOResponse woresponse = super.createResponseInContext(wocontext);
woresponse.setContentEncoding(_NSUtilities.UTF8StringEncoding);
return woresponse;
} also in the Application.java file
-using escapeHTML true or false don't change anything for my problem.
-the .strings file is UTF-8 encoded


when I have an "é" in the .strings file, it displays as "é" in the browser...

I cannot figure out how to keep my accentuated characters in the .strings file to display correctly in the browser:(

Does anyone know what could cause this?

Thanks you guys and have a nice sunday;)

Xavier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca _______________________________________________ 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: Text encoding issue using string file [solved]
      • From: Dev WO <email@hidden>
References: 
 >Text encoding issue using string file (From: Dev WO <email@hidden>)

  • Prev by Date: Text encoding issue using string file
  • Next by Date: Re: Text encoding issue using string file [solved]
  • Previous by thread: Text encoding issue using string file
  • Next by thread: Re: Text encoding issue using string file [solved]
  • Index(es):
    • Date
    • Thread