0

I have a very strange problem...

Inside a wordpress website i have this � sign when text are finished...

you can see it here in the left square.

Screenshot attached here to make its more clear.

Thanks!

Erez Lieberman
  • 1,893
  • 23
  • 31

2 Answers2

2

ok - finally i understand that its because the substr() php function... and in utf-8 you need to use the mb_substr() function like this:

<?php
        $utf8string = "cakeæøå";
        echo mb_substr($utf8string,0,5,'UTF-8');
?>

and NOT like this:

<?php
           $utf8string = "cakeæøå";
           echo substr($utf8string,0,5);
?>

from this comment

Erez Lieberman
  • 1,893
  • 23
  • 31
0

By above solution you will get rid of only for this text but think if same problem on more variables.

Please define character encoding scheme as below in the header.

  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

Please find more details at below:- http://www.w3schools.com/html/html_charset.asp

Deepak Dholiyan
  • 1,774
  • 1
  • 20
  • 35