What is the best way to deal with the NSDateFormatter locale “feature”?

Duh!! Sometimes you have an “Aha!!” moment, sometimes it’s more of a “Duh!!” This is the latter. In the category for initWithSafeLocale the “super” init was coded as self = [super init];. This inits the SUPERCLASS of NSDateFormatter but does not init the NSDateFormatter object itself. Apparently when this initialization is skipped, setLocale “bounces off”, … Read more

Changing Locale within the app itself

Through the original question is not exactly about the locale itself all other locale related questions are referencing to this one. That’s why I wanted to clarify the issue here. I used this question as a starting point for my own locale switching code and found out that the method is not exactly correct. It … Read more

List of All Locales and Their Short Codes?

The importance of locales is that your environment/os can provide formatting functionality for all installed locales even if you don’t know about them when you write your application. My Windows 7 system has 211 locales installed (listed below), so you wouldn’t likely write any custom code or translation specific to this many locales. Edit: The … Read more

Android get current Locale, not default

The default Locale is constructed statically at runtime for your application process from the system property settings, so it will represent the Locale selected on that device when the application was launched. Typically, this is fine, but it does mean that if the user changes their Locale in settings after your application process is running, … Read more

How to fix a locale setting warning from Perl

Here is how to solve it on Mac OS X v10.7 (Lion) or Cygwin (Windows 10): Add the following lines to your bashrc or bash_profile file on the host machine: # Setting for the new UTF-8 terminal support in Lion export LC_CTYPE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 If you are using Z shell (zsh), edit file zshrc: # Setting for … Read more

tech