Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localizable.strings in UTF-8 is working?

I am running Xcode 4.3 but the same thing works with Xcode 4.2. Previously, Localizable.strings file had to be in UTF-16 to be picked up by iOS; UTF-8 strings file did not work.

But this morning, I created a new test project and my Localizable strings files where created in UTF-8 by XCode. I did not realize it right away but they do work and are being used properly on the simulator, an iOS 5 iPad and a 4.3 iPad. My question is, do you know since when this has been working? Is this documented somewhere or do I have something messed up?

like image 823
droussel Avatar asked Dec 02 '11 16:12

droussel


People also ask

What are localizable strings?

A localized string can have different values depending on the language in which the project is being build. There are two categories of localized strings: the strings included in the installation package's UI, common to every MSI file.

How do you localize a string in Swift?

string file, select it and on the File Inspector (right menu) select “Localize”. Select your the new language you added and click on “Finish”. If you select the file again you should see something similar to the first image below (be sure to select both the supported languages).


2 Answers

I've been using UTF-8 strings files for some time. Never seen a problem.

However, Apple does still recommend UTF-16.

As of March 21, 2016, Apple recommends UTF-8

like image 76
David Dunham Avatar answered Sep 24 '22 07:09

David Dunham


I'm having problems with UTF-8 strings files under Xcode 4.3.2 building for iPhone 5.1.

It seems certain combinations of characters ( ':' or ">" in my case ) in the translated string are causing all translations after that character to use the string in the code, not the translated string.

like image 22
Tim Hinds Avatar answered Sep 24 '22 07:09

Tim Hinds