Recently, the development of iOS partners told me that the parsing server sent back the character information when a bug occurs.
Obviously using the log output is the string "hello" but the use of length calculation is more than two bytes, such as this is 7.
I heard no reason ah, so check my server output, first start to exclude whether in a certain echo or print time, the output of more than two characters.
But let me check to find out all the wood has this problem, directly from the server echo when judging the length of the output, also did not reproduce the problem.
Really a face, after all, PHP is not so familiar.
Finally, when I was 10 o'clock in the evening, I passed the string back through Python, and found that each returned string was preceded by a "\ r \ n", because the characters in the normal log were automatically wrapped and did not appear, so I didn't think of it at all.
I naturally went to find out how I showed the output "\ r \ n", but when I looked through the script and didn't find the two goods, my heart was a broken O (╯-╰) O.
Finally, the problem is that one of the include PHP scripts has a blank line at the end of the!!!!!
<? PHP Echo "Hello";? >// This empty line will cause you to output "\r\nhello" ...
So you just put a blank line in front of each of my outputs, manual black question mark face!
PHP is the best language in the world!!!!!!
Two-byte bug with PHP output string