0

Hi,

I'm taking texts from other page. In my page I use utf-8 encoding. When I print texts in my page, I get � for some symbols, for example for ö in German, or è in French.
I tried use file_get_contents, curl, but in these two ways output have � symbols.

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,"$path");
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle,CURLOPT_ENCODING,"");
curl_setopt($curl_handle,CURLOPT_HEADER,1);
$results = curl_exec($curl_handle);
curl_close($curl_handle);

In output I use xhtml for mobile (I'm creating WAP page):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />....

Also header:

header('Content-type: application/xhtml+xml; charset=utf-8');

Maybe You can help me to get texts without � symbols in correct encoding?

P.S.Sorry for bad English.

3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by xoxbet
0

Thanks for Your help! ;) Problem solved.

Hey man, would you tell me how you resolved your problem with wrong character set in curl_setopt? I have the same issue with weird characters and cannot find the way to encoded into proper format.

Thanks and appreciate
Jan

0

Hey man, would you tell me how you resolved your problem with wrong character set in curl_setopt? I have the same issue with weird characters and cannot find the way to encoded into proper format.

Thanks and appreciate
Jan

Hi,

I can't remember what I was coding then, but I used iconv function as pritaeas mentioned. I used UTF-8 as out_charset, but can't remember in_charset.

Edited by xoxbet: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.