php readdir problem with japanese language file name

后端 未结 6 1644
野性不改
野性不改 2020-11-29 13:55

I have the following code



        
6条回答
  •  醉话见心
    2020-11-29 14:10

    I think Windows uses UTF-16 for file names. So try the mb_convert_encoding function to convert from the internal encoding to your output encoding:

    // convert from UTF-16 to UTF-8
    echo mb_convert_encoding($file, 'UTF-8', 'UTF-16');
    

    Maybe you have to change some settings first (see mb_get_info).

提交回复
热议问题