Subversion Repositories eFlore/Applications.cel

Rev

Rev 582 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 582 Rev 601
Line 880... Line 880...
880
    foreach($cp1252_map as $k=>$v){
880
    foreach($cp1252_map as $k=>$v){
881
        $byte_map[$k]=$v;
881
        $byte_map[$k]=$v;
882
    }
882
    }
883
}
883
}
Line -... Line 884...
-
 
884
 
-
 
885
$byte_map=array();
-
 
886
init_byte_map();
-
 
887
$ascii_char='[\x00-\x7F]';
-
 
888
$cont_byte='[\x80-\xBF]';
-
 
889
$utf8_2='[\xC0-\xDF]'.$cont_byte;
-
 
890
$utf8_3='[\xE0-\xEF]'.$cont_byte.'{2}';
-
 
891
$utf8_4='[\xF0-\xF7]'.$cont_byte.'{3}';
-
 
892
$utf8_5='[\xF8-\xFB]'.$cont_byte.'{4}';
-
 
893
$nibble_good_chars = "@^($ascii_char+|$utf8_2|$utf8_3|$utf8_4|$utf8_5)(.*)$@s";
884
 
894
 
885
function fix_latin($instr){
895
function fix_latin($instr){
886
    if(mb_check_encoding($instr,'UTF-8'))return $instr; // no need for the rest if it's all valid UTF-8 already
896
    if(mb_check_encoding($instr,'UTF-8'))return $instr; // no need for the rest if it's all valid UTF-8 already
887
    global $nibble_good_chars,$byte_map;
897
    global $nibble_good_chars,$byte_map;
888
    $outstr='';
898
    $outstr='';