Hello,
I am writing a program that makes use of strftime() to produce localized results related to date and time.
The output is XML sent as UTF-8 so I need to make sure the locale is a UTF-8 locale.
setlocale(LC_TIME, 'ru_RU.UTF8')
for example works beautifully and does exactly what I need it to do, but detecting that is the locale to use is where I am having a problem.
For example, there are two Russian locales that FireFox in CentOS 7 can report - one is just ru and the second is ru-md
Appending a .UTF8 to either of those doesn't work.
I guess what I'm looking for, and I hope there is already a pear or PECL library, is some way to take the locale the browser reports and get a UTF8 safe locale I can use with setlocale for the purpose of strftime.
Any suggestions?