Hi,
I'm using CURL to import some code. However, in french, all the characters come out funny. For example: Bonjour ...
I don't have access to change anything on the imported code. Is there anything I can do my side to fix this?
Thanks
Hi,
I'm using CURL to import some code. However, in french, all the characters come out funny. For example: Bonjour ...
I don't have access to change anything on the imported code. Is there anything I can do my side to fix this?
Thanks
Your situation is unclear. Where does PHP come in? Is the content you're downloading PHP code? What are you using to view the text afterwards?
It's almost certainly just a case of handling the downloaded data in the appropriate encoding. However, you'll need to know what encoding that is (look at the HTTP headers for a possible hint, although it may not have been set correctly) and how to use the right encoding. We can't help you on the latter point until we know what you're doing with the data after fetching it.
Like Jon Skeet pointed it's difficult to understand your situation, however if you have access only to final text, you can try to use iconv for changing text encoding.
I.e.
$text = iconv("Windows-1252","UTF-8",$text);
I've had similar issue time ago (with Italian language and special chars) and I've solved it in this way.
Try different combination (UTF-8, ISO-8859-1, Windows-1252).
I'm currently suffering a similar problem, i'm trying to write a simple html <title>
importer cia cURL. So i'm going to give an idea of what i've done until now:
curl_getinfo()
and match it via regex<title>
tag (yes, i know the consequences)iconv()
the string$DEITY
punishes him/her until the end of the days, because it would save me the meta parsing$text = iconv("UTF-8","Windows-1252",$text);
that was definitely the answer for me too..
i was getting this type of characters.
– …