Name: Anonymous 2010-06-05 0:56
Is there any script, preferably bash or Perl, that will convert normal ASCII ("deal") into wide-width latin ("deal")?
Thanks.
Thanks.
function ascii_to_wwlatin ($str)
{
$retval = '';
foreach (str_split($str) as $chr) {
$ord = ord($chr);
$retval .= $ord > 32 && $ord < 127 ?
html_entity_decode('' . ($ord + 65248) . ';', ENT_NOQUOTES, 'UTF-8') :
chr($ord);
}
return $retval;
}echo ascii_to_wwlatin('Hi, >>1. I\'m using PHP. DEAL with it!');