- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
unction int2hex($intega){
$Ziffer = "0123456789ABCDEF";
return $Ziffer[($intega%256)/16].$Ziffer[$intega%16];
}
function url_encode($text){
$text = urlencode($text);
if(!strpos($text,"%C3"))
for($i=129;$i<255;$i++){
$in = "%".int2hex($i);
$out = "%C3%".int2hex($i-64);
$text = str_replace($in,$out,$text);
}
return $text;
}
function tounicode ($string){
$unistring="";
for($i=0;$i<strlen($string);$i++){
$current=$string[$i];
$codcurrent=ord($current);
if($codcurrent>255):
$unicurrent=utf8_encode($current);
$unistring=$unistring.$unicurrent;
elseif($codcurrent<192):
if($codcurrent==184):
$unicurrent=chr(209).chr($codcurrent-39);
$unistring=$unistring.$unicurrent;
elseif($codcurrent==168):
$unicurrent=chr(208).chr($codcurrent-39);
$unistring=$unistring.$unicurrent;
elseif($codcurrent==147):
$unicurrent=utf8_encode("\"");
$unistring=$unistring.$unicurrent;
elseif($codcurrent==148):
$unicurrent=utf8_encode("\"");
$unistring=$unistring.$unicurrent;
elseif($codcurrent==151):
$unicurrent=utf8_encode("-");
$unistring=$unistring.$unicurrent;
else:
$unicurrent=utf8_encode($current);
$unistring=$unistring.$unicurrent;
endif;
else:
if ($codcurrent<240):
$unicurrent=chr(208).chr($codcurrent-48);
$unistring=$unistring.$unicurrent;
else:
$unicurrent=chr(209).chr($codcurrent-112);
$unistring=$unistring.$unicurrent;
endif;
endif;
}
return $unistring;
}
guest 30.06.2009 04:04 # 0