• 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: Re(3): More localization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re(3): More localization


  • Subject: Re: Re(3): More localization
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 12 Dec 2001 10:45:30 -0800

On Wednesday, December 12, 2001, at 09:56 AM, Jens Bauer wrote:

Is it documented anywhere that the strings file MUST have a unicode
encoding of some sort? I had the exact same problem. Luckily BBEdit
saved the day.

After a closer look, I think that there's something fishy going on.
In the file "Localizable.strings", I use the danish character 'f', however,
it shows up fine in the dialog-box. I now converted the other file,
"Custom.strings" to a plain string-list again, just to make it consistent.
Now, I found out that the character is in fact changed to a 16bit character
(2 bytes wide), that's the real reason it works. But then again, I find this
strange, because in the other file, it works... Is the Localizable.strings
a special file, or is the encoding in fact saved with the document ?
-If it is, I think I just have to duplicate the original Localized.strings
and rename it Custom.strings. ;)

This is a common question. Here's the answer:

There are several different formats that are supported for .strings files. The most common and most convenient one is the so-called strings file format, consisting of lines of the form "a" = "b"; with optional C-style comments. If you use this format, you should always make sure that your file is saved as Unicode, or you are likely to have sporadic encoding problems.

The most common alternative format for .strings files is the standard XML plist format. If you use this format, then you should make sure that your file is saved as UTF-8, or you are likely to have sporadic encoding problems. Make sure that you also follow XML standards for escaping characters such as "<" that have special meaning to XML.

TextEdit can open and save documents using Unicode, UTF-8, and a variety of other encodings; one of the principal benefits of the strings file format is that it is readily editable using TextEdit or other text editors. TextEdit will automatically recognize Unicode files by their leading byte-ordering-mark, so once you have saved a file as Unicode, TextEdit will keep it that way. I believe genstrings will automatically create properly formatted Unicode strings file format files.

PropertyListEditor will automatically create properly escaped UTF-8 XML plists. It is probably the most convenient tool for editing XML plists, but it is still not as convenient for localization as using strings file format with a text editor.

Douglas Davidson


  • Follow-Ups:
    • Re: Re(3): More localization
      • From: Rosyna <email@hidden>
    • Re(5): More localization
      • From: Jens Bauer <email@hidden>
References: 
 >Re(3): More localization (From: Jens Bauer <email@hidden>)

  • Prev by Date: Re: unespected behavior of some NSWindow, NSView methods
  • Next by Date: Re(5): More localization
  • Previous by thread: Re(3): More localization
  • Next by thread: Re(5): More localization
  • Index(es):
    • Date
    • Thread