CURL import character encoding problem

前端 未结 5 1492
暖寄归人
暖寄归人 2020-12-03 19:43

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

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-03 19:56

    You could replace your

    $data = curl_exec($ch);
    

    by

    $data = utf8_decode(curl_exec($ch));
    

    I had this same issue and it worked well for me.

提交回复
热议问题