From 4e17e6c9dbac8991ee8b302cb2581241247dc8bc Mon Sep 17 00:00:00 2001 From: thomascube Date: Sun, 25 Sep 2005 14:18:03 +0000 Subject: Initial revision --- program/lib/icl_commons.inc | 81 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 program/lib/icl_commons.inc (limited to 'program/lib/icl_commons.inc') diff --git a/program/lib/icl_commons.inc b/program/lib/icl_commons.inc new file mode 100644 index 000000000..599205178 --- /dev/null +++ b/program/lib/icl_commons.inc @@ -0,0 +1,81 @@ +=224 && $val<=239){ + $unicode = ($val-224) * 4096 + (ord($str[$i+1])-128) * 64 + (ord($str[$i+2])-128); + $i+=2; + $utf_code.=chr((int)($unicode/256)).chr($unicode%256); + }else if ($val>=192 && $val<=223){ + $unicode = ($val-192) * 64 + (ord($str[$i+1])-128); + $i++; + $utf_code.=chr((int)($unicode/256)).chr($unicode%256); + }else{ + if ($utf_code){ + $out.='&'.mod_b64_encode($utf_code).'-'; + $utf_code=""; + } + if ($str[$i]=="-") $out.="&"; + $out.=$str[$i]; + } + } + if ($utf_code) + $out.='&'.mod_b64_encode($utf_code).'-'; + return $out; +} + + +?> \ No newline at end of file -- cgit v1.2.3