The latest code of utf8RawUrlDecode in utils.php:<br>function utf8RawUrlDecode($str) {<br>$str = rawurldecode($str);<br> preg_match_all("/(?:%u.{4})|&#x.{4};|&#\d+;|.+/U",$str,$r);<br> $ar = $r[0];<br>
foreach($ar as $k=>$v) {<br> if(substr($v,0,2) == "%u")<br> $ar[$k] = iconv("UCS-2","UTF-8",pack("H4",substr($v,-4)));<br> elseif(substr($v,0,3) == "&#x")
<br> $ar[$k] = iconv("UCS-2","UTF-8",pack("H4",substr($v,3,-1)));<br> elseif(substr($v,0,2) == "&#") {<br> //echo substr($v,2,-1)."<br>";
<br> $ar[$k] = iconv("UCS-2","UTF-8",pack("n",substr($v,2,-1)));<br> }<br> }<br> $str1 = join("",$ar);<br> $str1 = nl2br($str1);<br> return $str1;<br>}
<br><br>above code is able to solve problems for the ajax edit with utf characters.<br><br><div><span class="gmail_quote">On 2/19/07, <b class="gmail_sendername">Erik Bent</b> <<a href="mailto:erik@bentware.nl">erik@bentware.nl
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello team,<br><br>I finally found a solution for the ajax edit with utf characters (I
<br>hope). The entered text is transformed to a string without % character<br>(in dtlviewajax.js: % => |) and then send to php (routine<br>utf8RawUrlDecode in utils.php). There the | character is translated to %<br>and the %XX and %uXXXX are translated to characters.
<br>I have used html_entity_decode to convert &#911; back to unicode for php<br>5 (according to <a href="http://www.php.net">www.php.net</a>). In php 4 the text stays &#911; but on the<br>screen the correct character is displayd (Ώ).
<br><br>Regards,<br>Erik<br>_______________________________________________<br>Reach hundreds of potential candidates - <a href="http://jobs.vtiger.com">http://jobs.vtiger.com</a> </blockquote></div><br><br clear="all"><br>
-- <br>________________________________________<br>中国开源客户关系管理系统: <a href="http://www.c3crm.com">http://www.c3crm.com</a><br>-----------------------------------------------------------------------