CURL 导入字符编码问题 [英] CURL import character encoding problem

查看:22
本文介绍了CURL 导入字符编码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 CURL 导入一些代码.然而,在法语中,所有的角色都很有趣.例如:卓悦...

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?

谢谢

推荐答案

就像 Jon Skeet 指出的那样,很难理解您的情况,但是如果您只能访问最终文本,您可以尝试使用 iconv 用于更改文本编码.

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.

$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.

尝试不同的组合(UTF-8、ISO-8859-1、Windows-1252).

Try different combination (UTF-8, ISO-8859-1, Windows-1252).

这篇关于CURL 导入字符编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆