title: Why the utf8 characters are seeming like question mark?
body: <p>I have a form in my website. I am reviewing the form values on ui panel. Function is doing if the the word length is greater than 12 it puts a space to next to it. But when I print the value I am getting error if value is utf8.</p>
  
  <pre><code>$text= 'üğqwoweğofkeiasş övafevpğeüqrg qğekqrğofteölzfs';
  
  function parser($str, $parse) {
      $strlength = strlen($str);
      $counter = 0;
      $query = '';
  
      if($strlength &gt; $parse) {
          for($i = 0; $i &lt; $strlength; $i++) {
              if($str[$i] != ' ') {
                  $counter++;
              }
  
              if($counter == $parse) {
                  $query.=$str[$i];   
                  $query.=' ';
                  $counter = 0;
              } 
  
              if($counter != $parse) {
                  $query.=$str[$i];
              }
  
              if($counter != $parse &amp; $str[$i] == ' ') {
                  $counter = 0;   
              } 
          }
  
          return $query;
      }
      else {
          return $str;    
      }
  }
  
  echo parser($text,12);
  </code></pre>
  
  <p>Output is: </p>
  
  <pre><code>'üğqwoweğo ofkeiasş övafevpğe� üqrg qğekqrğoft teölzfs'
  </code></pre>
  
  <p>and it's not happening all the times just sometimes; I can't understand why is that.</p>