Is there a standard way to do an fopen with a unicode string file path?

前端 未结 3 964

Is there a standard way to do an fopen with a unicode string file path?

3条回答
  •  旧时难觅i
    2020-12-10 02:53

    This is a matter of your current locale. on my system, which is unicode enabled, file paths will be in unicode. I'm able to detect this by means of the locale command:

    $ locale
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    

    The encoding of file paths is normally set system wide, so if your file path is not in the system's locale, you will need to convert it, perhaps by means of the iconv library.

提交回复
热议问题