PHP Classes

Unicode process bug

Recommend this page to a friend!

      PHP Input Filter  >  All threads  >  Unicode process bug  >  (Un) Subscribe thread alerts  
Subject:Unicode process bug
Summary:Special Characters gone BAD
Messages:2
Author:Liel
Date:2009-04-11 21:57:47
Update:2010-11-19 14:26:38
 

  1. Unicode process bug   Reply   Report abuse  
Picture of Liel Liel - 2009-04-11 21:57:47
Hi, I love using this class, but I currently updating my site to support unicode based user input I get the awful q-marks (on this post are seen as �) - take a look at the output near the word vision.

If anyone has a suggestion, I would appreciate!

CODE:
// PRINT BEFORE ($fields is $_POST)
print_r($fields);
// Allow minimal html structure.
$tags =array("br","p","strong","em","ul","li","a", "ol");
$attr =array("href", "title", "alt");
$myFilter = new InputFilter($tags, $attr);
$fields = $myFilter->process($fields);
// PRINT AFTER($fields is $_POST)
print_r($fields);

OUTPUT:

Array
(
[mission] =&gt; <p><strong>My new </strong><em><strong>vision ZçÇáà éèíì óòõú<br>

</strong></em><a href="http://mokoko.com">Kookok</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
)
Array
(
[mission] =&gt; <p><strong>My new </strong><em><strong>vision Z&#65533;&#65533;&#65533;&#65533; &#65533;&#65533;&#65533;&#65533; &#65533;&#65533;&#65533;&#65533;<br>

</strong></em><a href="http://mokoko.com">Kookok</a></p>
<p>&#65533;</p>
<p>&#65533;</p>
)

  2. Re: Unicode process bug   Reply   Report abuse  
Picture of Pesti G Pesti G - 2010-11-19 14:26:38 - In reply to message 1 from Liel
Serach for string ISO-8859-1 in class.inputfilter* files, and replace it for UTF-8.