0

I have a weard problem. I have two seperate files, with absolutely same code, one with problem, one without.

code:

<?php

$kll="šžćčš";

?>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<!-- Meta Tags -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="" />

<!-- END head -->
</head>
<!-- BEGIN body -->

<body>

<?php echo $kll; ?>

</body> 

Now, when rendered it should output simple result as: šžćčš, but in one file it doesnt, it outputs: �����

What bugs me is that the code is absolutely the same for both files. You can check it out: http://www.husibegovic.com/tt.php (bad one) http://www.husibegovic.com/cc.php (good one)

Any help please? Thank you

uollaa
  • 17
  • 1
  • 4
  • You need to **save the file with UTF-8 extension** for this to work. To modify the file to make it UTF-8, try adding UTF-8 BOM: `file_put_contents($yourFile, "\xEF\xBB\xBF". file_get_contents($yourFile));`. – Amal Murali Mar 04 '14 at 18:01
  • 4
    You saved your file with a wrong charset then. – mario Mar 04 '14 at 18:04
  • +1 @mario Comparing the files should reveal if this is indeed the case. On Unix, try `cmp` or `diff`. – tripleee Mar 04 '14 at 18:06
  • absolutelly same code, I did copy paste, from first to last line, freaking out here :D – uollaa Mar 04 '14 at 18:18

0 Answers0