Could you tell me a fopen problem? I used fopen to open a file, but the file path contains Japanese characters, so that the file cannot be found. How can this problem be solved? Thank you! ------ Solution ------------------ change the file name to English ------ solution -------------------- I have encountered this problem before. then I changed the file name to English, I have never encountered this problem again. ------ Could you tell me a question about fopen?
I use fopen to open a file, but the file path contains Japanese characters, so that the file cannot be found. How can this problem be solved? Thank you!
------ Solution --------------------
Change the file name to English.
------ Solution --------------------
I have encountered this problem before. After I changed the file name to English, I never encountered this problem again.
------ Solution --------------------
$ Path = '{}.txt ';
$ Fp = fopen ($ path, "r ");
$ F = fread ($ fp, filesize ($ path ));
Echo $ f;
Fclose ($ fp );
It is tested that there is no problem in Windows and linux (centos.
Check whether the file path is correct.
------ Solution --------------------
The encoding may be different. for example, the English system may use unicode encoding.
The real Japanese system may be Japanese-coded, such as shift-jis.
In fact, just use the mt encoding conversion function to convert it. just try it several times.
To read a file, you must use the system encoding. Therefore, the string must be converted from the PHP file encoding to the system encoding.
------ Solution --------------------
Can you create a new Japanese file name in English version 2012?
------ Solution --------------------
Try to recreate this file in the English version.