search

Home  >  Q&A  >  body text

php gets operating system encoding

I recently used the scandir() function in developing a project

I found a problem during use:

When I traversed the file, garbled characters appeared under windows, but not garbled under Linux. , the tutorial found on the Internet said that the obtained file is gbk transcoded to utf-8.

But after transcoding, windows are no longer garbled, but Linux is garbled. At this time, I thought of another solution that is to judge the system and only transcode windows.

But the problem occurred again. I used PHPstudy to build a development environment locally. There was no problem at all. I transferred the project to the server. The server used a windows system. I also used PHPstudy to build the environment. , something went wrong when using the project. I don’t know how to solve it. Is there any way to solve it?

China丶MoliChina丶Moli2045 days ago1376

reply all(3)I'll reply

  • 勇敢的心

    勇敢的心2019-07-22 16:33:47

    Try to transfer to one more level

    reply
    0
  • China丶Moli

    Could you please explain it in detail? Thank you.

    China丶Moli · 2019-07-22 19:12:51
  • China丶Moli

    China丶Moli2019-07-22 15:20:24

    Occupy the first floor by yourself

    reply
    0
  • Cancelreply