michaelfox + unicode 10
unicode decode — Gist
march 2011 by michaelfox
<?php
function uniDecode($str,$charcode){
$text = preg_replace_callback("/%u[0-9A-Za-z]{4}/",'toUtf8',$str);
return mb_convert_encoding($text, $charcode, 'utf-8');
}
function toUtf8($ar){
$c = null;
foreach($ar as $val){
$val = intval(substr($val,2),16);
if($val < 0x7F){ // 0000-007F
$c .= chr($val);
}elseif($val < 0x800) { // 0080-0800
$c .= chr(0xC0 | ($val / 64));
$c .= chr(0x80 | ($val % 64));
}else{ // 0800-FFFF
$c .= chr(0xE0 | (($val / 64) / 64));
$c .= chr(0x80 | (($val / 64) % 64));
$c .= chr(0x80 | ($val % 64));
}
}
return $c;
}
php
utf8
unicode
charset
function uniDecode($str,$charcode){
$text = preg_replace_callback("/%u[0-9A-Za-z]{4}/",'toUtf8',$str);
return mb_convert_encoding($text, $charcode, 'utf-8');
}
function toUtf8($ar){
$c = null;
foreach($ar as $val){
$val = intval(substr($val,2),16);
if($val < 0x7F){ // 0000-007F
$c .= chr($val);
}elseif($val < 0x800) { // 0080-0800
$c .= chr(0xC0 | ($val / 64));
$c .= chr(0x80 | ($val % 64));
}else{ // 0800-FFFF
$c .= chr(0xE0 | (($val / 64) / 64));
$c .= chr(0x80 | (($val / 64) % 64));
$c .= chr(0x80 | ($val % 64));
}
}
return $c;
}
march 2011 by michaelfox
Unicode code converter [ishida >> utilities]
august 2010 by michaelfox
ype or paste text in any of the green or grey shaded boxes and click on the button Convert button above it. Alternative representations will appear in all the other boxes. You can then cut & paste the results into your document. Select selects all the text in a box. Scroll down the page for notes on other options.
tools
unicode
ascii
encoding
html
converter
utf-8
august 2010 by michaelfox
related tags
ascii ⊕ bash ⊕ character ⊕ characters ⊕ charactersets ⊕ charset ⊕ chart ⊕ cli ⊕ converter ⊕ dingbats ⊕ emoji ⊕ encode ⊕ encoding ⊕ escape ⊕ fonts ⊕ git ⊕ glyphs ⊕ hacks ⊕ html ⊕ ios ⊕ javascript ⊕ pastie ⊕ pastie-325104 ⊕ php ⊕ prompt ⊕ reference ⊕ search ⊕ setup ⊕ shell ⊕ symbol ⊕ symbols ⊕ text ⊕ tools ⊕ typography ⊕ unicode ⊖ utf-8 ⊕ utf8 ⊕ zsh ⊕Copy this bookmark: