Subversion Repositories eFlore/Applications.cel

Rev

Rev 602 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 602 Rev 606
Line 842... Line 842...
842
 
842
 
Line 843... Line 843...
843
 
843
 
844
}
844
}
845
 
845
 
846
function init_byte_map(){
846
function init_byte_map(){
847
    global $byte_map;
847
    $byte_map = array();
848
    for($x=128;$x<256;++$x){
848
    for($x=128;$x<256;++$x){
849
        $byte_map[chr($x)]=utf8_encode(chr($x));
849
        $byte_map[chr($x)]=utf8_encode(chr($x));
Line 878... Line 878...
878
            "\x9F" => "\xC5\xB8"       // LATIN CAPITAL LETTER Y WITH DIAERESIS
878
            "\x9F" => "\xC5\xB8"       // LATIN CAPITAL LETTER Y WITH DIAERESIS
879
                );
879
                );
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
    
-
 
884
    return $byte_map;
883
}
885
}
Line 884... Line 886...
884
 
886
 
Line 885... Line -...
885
function fix_latin($instr){
-
 
886
    
887
function fix_latin($instr){
-
 
888
    
887
    $byte_map=array();
889
    $byte_map = init_byte_map();
888
    init_byte_map();
890
    
889
    $ascii_char='[\x00-\x7F]';
891
    $ascii_char='[\x00-\x7F]';
890
    $cont_byte='[\x80-\xBF]';
892
    $cont_byte='[\x80-\xBF]';
891
    $utf8_2='[\xC0-\xDF]'.$cont_byte;
893
    $utf8_2='[\xC0-\xDF]'.$cont_byte;
892
    $utf8_3='[\xE0-\xEF]'.$cont_byte.'{2}';
894
    $utf8_3='[\xE0-\xEF]'.$cont_byte.'{2}';
-
 
895
    $utf8_4='[\xF0-\xF7]'.$cont_byte.'{3}';
893
    $utf8_4='[\xF0-\xF7]'.$cont_byte.'{3}';
896
    $utf8_5='[\xF8-\xFB]'.$cont_byte.'{4}';
Line 894... Line 897...
894
    $utf8_5='[\xF8-\xFB]'.$cont_byte.'{4}';
897
    
895
    $nibble_good_chars = "@^($ascii_char+|$utf8_2|$utf8_3|$utf8_4|$utf8_5)(.*)$@s";
898
    $nibble_good_chars = "@^($ascii_char+|$utf8_2|$utf8_3|$utf8_4|$utf8_5)(.*)$@s";
896
 
899