There’s no place like ::1

Mac OS Sucks (Part 1 of N) - Locale Settings

| Comments

This will be the first of many articles about why mac os sucks for the everyday developer work…

I’m mainly working with Perl now, and I started to have problems as soon as I went to mac os. The modules I was used to work with started to fail on mac os. After some digging I found that every failure was related with some string format problem.

For example, I discovered that this expression sprintf '%f' 0.3 gives you the string 0,300000 and not the “expected” 0.300000. You can’t imagine how this thing breaks some Perl modules…

Then I realized that my locale settings were defined to C. Clearly that could be a problem. Google helped me a bit, and I found this website that has instructions on how to prepare your mac os to the correct locale and unicode settings.

A little bit of hacking later (I set my new locale to en_US.UTF-8), a new bash from macports, and sprintf started to behave “correctly”, and Perl modules no longer complain :-) Great success!

Comments