Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Translate the Weather widget into other languages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Translate the Weather widget into other languages
Authored by: xavierbdm on May 13, '05 06:59:59PM

Regarding accents and their interpretation:
beware! They are not encoded weirdly on purpose: they seem weird to you because the text file apparently DOES NOT specify its encoding.
So you text editor assumes by default it is in Western Mac OS Roman.
But the files are actually handled as UTF-8 (like most OS X default encoding is or should be). So the system (Safari to be exact) expects them to be UTF-8.

Take another already localized widget (the French.lproj localizedstrings.js from WordClock for instance)
If you use the (free for personal use and extremely powerful) marvelous SubEthaEdit text editor ( http://www.codingmonkeys.de ), just open the file, and go to the menu "Format>File Encoding" and choose UTF-8: then choose "re-interpret" (which forces the text editor to re-read the file as encoded in UTF-8 and not its default interpreation): ta-daah! All accents are there.
(beware: don't use "convert" as the editor would parse the file as it is seen now and try and make sense of the bytes as if they meant something in UTF-8.
Now, if you want to make a localized version of any widget, remember to set the file's encoding to UTF-8, before writing into it.

Now, I'll leave it as an practical application to the reader to try and find why TextEdit persists in seeing Apple's own files as Western Mac Roman...

(...When it is all over the documentation that UTF-8 is the default encoding in Tiger, and the true way to have a system able to deal with the world's various langugaes.)


---
iMac G4 17 800/512/80 + powerbook firewire G3 500/512/30



[ Reply to This | # ]