Php
Using PHP to read the TXT file data (words, phonetic transcription and translation) to another TXT file, garbled, what is the reason?
Reply to discussion (solution)
Of course because the coding is inconsistent.
How to solve it?
Of course because the coding is inconsistent.
How to solve it?
Of course because the coding is inconsistent.
Encoding Conversion
Http://www.baidu.com/s?wd=PHP+%B1%E0%C2%EB%D7%AA%BB%BB
Let's look at the code for a file, like UTF-8.
And look at the code for file B, like GB1312.
First $text=fget ($FPA)
Re-$text=iconv (' Utf-8 ', ' GBK ', $text)
Write to File B again
Let's look at the code for a file, like UTF-8.
And look at the code for file B, like GB1312.
First $text=fget ($FPA)
Re-$text=iconv (' Utf-8 ', ' GBK ', $text)
Write to File B again
The code for the two files is the same. I want to separate the words, the phonetic transcription and the translation, and then write to the b.txt in a specific format. Two files are Lucida Sans Unicode, is my PHP code faulty?
read out what is, write out to get or what.
No coding problems, unless you have a problem with your code
You can give the test data and code
There are both phonetic and translation, do not think, it is certainly Unicode, but, Unicode is just a name, specifically UTF-8,UTF-16,UC2 ... Or you have to judge, to keep the original txt, output txt and PHP program itself, the code of the three consistent
Read the time with "RB", write the time with "WB", the intermediate conversion format with Echo to see, if the echo results are OK, the output is no problem
Post the code and look at it.
File encoding (UTF8,ANSI) format to be consistent