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
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
I had a similar problem. I tried to loop through all combinations of input and output charsets. Nothing helped! :(
However I was able to access the code that actually fetched the data and this is where the culprit lied. Data was fetched via cURL. Adding
fixed it.
A handy set of code to try out all possible combinations of a list of charsets:
You could replace your
by
I had this same issue and it worked well for me.
PHP seems to use UTF-8 by default, so I found the following works
$text = iconv("UTF-8","Windows-1252",$text);
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.
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