Do you have a question? Post it now! No Registration Necessary. Now with pictures!
April 16, 2008, 4:20 am
rate this thread
get back get corrupted for non-ASCII characters. For instance when do
a readfile("http://abc/def") "S=E3o Paulo" became "S=C3=A3o Paulo" on the
calling page although http://abc/def shows "S=E3o Paulo" correctly. Any
idea on how to fix this problem.
Let me try to explain it more. I have two pages http://abc/def,
http://abc/ghi.php and I am trying to read the contents of http://abc/def
Re: Multibyte character?
What you get is exactly right. From your example, it appears that your
text is utf-8 encoded and that the second page is (probably) latin-1
encoded. A "readfile" without respecting any encodings is not enough to
display "human" text.
If you use curl, you can catch the headers that contain the encoding
used and use mbstring to convert it. Or if it is always the same page
you read, you know the encoding beforehand.