Unicode setlocale and strftime fails at windows

故事扮演 提交于 2019-12-02 01:09:47

For those who is having similar problems on linux (this may work also for windows but not sure).

Yes there is 'turkish' but there is also 'tr_TR.utf8' . If you use 'tr_TR.utf8' most probably your problems will be washed away. Same thing applies also to 'greek'. Instead use 'el_GR.utf8'

On linux you can check the locale list to find the proper settings for your site.

locale -a

List is too long and you can't see all languages, so either you can just dump it into a file and then open the file to check.

locale -a > locale.txt
vi locale.txt

or do locale -a | grep languagecode for a specific language

locale -a | grep tr

Microsoft Windows does not support UTF-8 locales. So if you provide turkish locale, it would pic an 8-bit code page that allows representation of specific language.

For example for locale Hebrew it would pic codepage-1255, for Turkish it would probably be 1254.

So, you can't use this under MS-Windows platform.

How can run the code fine both of two system(without using iconv).

Probably use non-utf8 encoding under MS Windows.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!