I was trying to generate a localized date string with strftime
, the placeholder I use is %x
. The language/locale is setlocale(LC_ALL, array(\
If my examination of setlocale() is correct, the answer is: No and no. The range of installed locales varies, as does their name, and the availability of a certain locale ultimately cannot be predicted with total certainty.
Feasible, yes. Wise, not at all!
You can check the return value of setlocale and at least check that it was installed. Otherwise you will have silent failures:
setlocale(LC_ALL, 'en_US') or die('Locale not installed');