2

I have the below string (in Turkish):

$string = "Otpor lideri Maroviç: Gezi eylemcileriyle temasımız olmadı";

However, when I attempt to echo the string, I get the below result:

Otpor lideri Maroviç: Gezi eylemcileriyle temas?m?z olmad?

How can I solve this problem?

Chris Forrence
  • 9,860
  • 11
  • 47
  • 62
Nikul
  • 1,015
  • 1
  • 12
  • 31

3 Answers3

2

First of all:

$string = "Otpor lideri Maroviç: Gezi eylemcileriyle temasımız olmadı";
echo htmlentities($string);

And make sure to add... to your head

<meta charset="UTF-8">
AwesomeGuy
  • 533
  • 3
  • 14
2
header('Content-type: text/plain; charset=utf-8');
$string = "Otpor lideri Maroviç: Gezi eylemcileriyle temasımız olmadı";
echo $string;
fortune
  • 3,293
  • 1
  • 19
  • 30
1

Open your file with code editor ex. Notepad++ and use "Convert to UTF-8" function. This should help. Here in Poland we are also using special characters and this is a common problem.

Tikky
  • 1,128
  • 2
  • 13
  • 31