In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "how to solve the problem that fopen can not create Chinese file name files in php". In daily operation, I believe many people have doubts about how to solve the problem that fopen can not create Chinese file name files in php. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful for you to answer the question "how to solve the problem that fopen in php cannot create a Chinese file name file"! Next, please follow the editor to study!
In the past, the chartset of the web page uses utf-8, and the file also uses utf-8, and then uses fopen () to create a file with a Chinese file name. The file name is all garbled!
Look at a lot of documents and try a lot of methods can not be solved, originally wanted to use other ways to bypass this problem, suddenly flashed in my mind Windows default text encoding is ansi, and then baidu, confirmed this point, so my web page should also be ansi coding so that the file name created will not be garbled.
Then we started to verify that we saved all the web pages with ansi and removed the chartset sentence. Sure enough, the content of the web page became garbled. Later, I remembered that this web page also include other web pages, and changed the include web page to ansi. Haha, everything ok
The work of programming really depends on accumulation. If I haven't seen Windows default code ansi before, then I don't know when this problem will be solved.
Ps:
< meta content ="text/html; charset=utf-8" http -equiv ="Content-type" >This meta tag must be placed before it is valid.
Later, I came up with a better solution: the web page is still encoded and saved in utf-8, but the file name parameter in fopen () can be coded separately. Php has the program to change the code of iconv (), and converting utf-8 to gb2312 can avoid garbled Chinese file names.
Test.htm
Title: {title} content of this news: {content}
Test.php
At this point, the study on "how to solve the problem that fopen can not create Chinese file name files in php" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.