1

I set up both PHP 5 and Apache to use UTF-8 encoding. I tried to show in my browser the result of this PHP code:

echo "Trying to visualize the letter ü"

and it shows me this result:

Trying to visualize the letter �

Why?

sl34x
  • 51
  • 2
  • 8

2 Answers2

0

Try this :

<?php
header('Content-Type: text/plain; charset=utf-8');
echo "Trying to visualize the letter ü";

If this doesn't work, than your file is in different encoding that utf-8.

What's different between UTF-8 and UTF-8 without BOM?

Change File Encoding to utf-8 via vim in a script

Community
  • 1
  • 1
Glavić
  • 39,315
  • 12
  • 70
  • 99
  • Thanks a lot. I solved by saving the file in UTF-8 (default was ANSI). I did "File->Save as..->Encoding: UTF-8". – sl34x Aug 16 '13 at 14:59
0

Make sure you set your documents "Content-Type" http header, and set the charset to the encoding that you're using:

header("Content-Type: text/html; charset=utf-8");
Lee Davis
  • 4,377
  • 2
  • 24
  • 37