fixed a bug in the character conversion to utf-8 function

This commit is contained in:
SJ
2012-08-01 21:53:01 +02:00
parent 8bf9fb318b
commit 7c7b30b544
3 changed files with 46 additions and 8 deletions

View File

@ -346,6 +346,8 @@ class ModelSearchMessage extends Model {
$what = preg_replace("/^\=\?/", "", $what);
$what = preg_replace("/\?\=$/", "", $what);
$encoding = substr($what, 0, strpos($what, '?'));
if(preg_match("/\?Q\?/i", $what)){
$x = preg_replace("/^([\w\-]+)\?Q\?/i", "", $what);
@ -360,9 +362,8 @@ class ModelSearchMessage extends Model {
$s = preg_replace('/\0/', "*", $s);
}
if(!preg_match("/utf-8/i", $what)){
$s = utf8_encode($s);
if(!preg_match("/utf-8/i", $encoding)){
$s = iconv($encoding, 'utf-8', $s);
}
}