note 85050 added to function.chr
| From: | JoshB dot at osu1 dot php dot net | Date: | Tue, 12 Aug 2008 21:06:47 +0000 |
| Subject: | note 85050 added to function.chr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143423@lists.php.net to get a copy of this message | ||
In addition to replacing Microsoft Windows smart quotes, as sgaston demonstrated on 2006-02-13, I
replace all other Microsoft Windows characters using suggestions[1] published by character code
specialist[2] Jukka Korpela.
<?php
$str = str_replace(chr(130), ',', $str); // baseline single quote
$str = str_replace(chr(131), 'NLG', $str); // florin
$str = str_replace(chr(132), '"', $str); // baseline double quote
$str = str_replace(chr(133), '...', $str); // ellipsis
$str = str_replace(chr(134), '**', $str); // dagger (a second footnote)
$str = str_replace(chr(135), '***', $str); // double dagger (a third footnote)
$str = str_replace(chr(136), '^', $str); // circumflex accent
$str = str_replace(chr(137), 'o/oo', $str); // permile
$str = str_replace(chr(138), 'Sh', $str); // S Hacek
$str = str_replace(chr(139), '<', $str); // left single guillemet
$str = str_replace(chr(140), 'OE', $str); // OE ligature
$str = str_replace(chr(145), "'", $str); // left single quote
$str = str_replace(chr(146), "'", $str); // right single quote
$str = str_replace(chr(147), '"', $str); // left double quote
$str = str_replace(chr(148), '"', $str); // right double quote
$str = str_replace(chr(149), '-', $str); // bullet
$str = str_replace(chr(150), '-', $str); // endash
$str = str_replace(chr(151), '--', $str); // emdash
$str = str_replace(chr(152), '~', $str); // tilde accent
$str = str_replace(chr(153), '(TM)', $str); // trademark ligature
$str = str_replace(chr(154), 'sh', $str); // s Hacek
$str = str_replace(chr(155), '>', $str); // right single guillemet
$str = str_replace(chr(156), 'oe', $str); // oe ligature
$str = str_replace(chr(159), 'Y', $str); // Y Dieresis
?>
[1] On the use of some MS Windows characters in HTML
http://www.cs.tut.fi/~jkorpela/www/windows-chars.html
[2] Unicode Explained by Jukka Korpela
http://www.amazon.com/dp/059610121X/
----
Server IP: 64.71.164.2
Probable Submitter: 96.253.164.102
----
Manual Page -- http://www.php.net/manual/en/function.chr.php
Edit -- https://master.php.net/note/edit/85050
Del: integrated -- https://master.php.net/note/delete/85050/integrated
Del: useless -- https://master.php.net/note/delete/85050/useless
Del: bad code -- https://master.php.net/note/delete/85050/bad+code
Del: spam -- https://master.php.net/note/delete/85050/spam
Del: non-english -- https://master.php.net/note/delete/85050/non-english
Del: in docs -- https://master.php.net/note/delete/85050/in+docs
Del: other reasons-- https://master.php.net/note/delete/85050
Reject -- https://master.php.net/note/reject/85050
Search -- https://master.php.net/manage/user-notes.php