Skip to content

Instantly share code, notes, and snippets.

@thlib
Forked from ceejayoz/gist:139687
Last active December 28, 2015 13:58
Show Gist options
  • Save thlib/7511078 to your computer and use it in GitHub Desktop.
Save thlib/7511078 to your computer and use it in GitHub Desktop.
$text = str_replace(chr(130), ',', $text); // baseline single quote: ‚
$text = str_replace(chr(131), 'NLG', $text); // florin: ƒ
$text = str_replace(chr(132), '"', $text); // baseline double quote: „
$text = str_replace(chr(133), '...', $text); // ellipsis: …
$text = str_replace(chr(134), '**', $text); // dagger (a second footnote): †
$text = str_replace(chr(135), '***', $text); // double dagger (a third footnote): ‡
$text = str_replace(chr(136), '^', $text); // circumflex accent: ˆ
$text = str_replace(chr(137), 'o/oo', $text); // permile: ‰
$text = str_replace(chr(138), 'Sh', $text); // S Hacek: Š
$text = str_replace(chr(139), '<', $text); // left single guillemet: ‹
$text = str_replace(chr(140), 'OE', $text); // OE ligature: Œ
$text = str_replace(chr(142), 'Z', $text); //: Ž
$text = str_replace(chr(145), "'", $text); // left single quote: ‘
$text = str_replace(chr(146), "'", $text); // right single quote: ’
$text = str_replace(chr(147), '"', $text); // left double quote: “
$text = str_replace(chr(148), '"', $text); // right double quote: ”
$text = str_replace(chr(149), '-', $text); // bullet: •
$text = str_replace(chr(150), '-', $text); // endash: –
$text = str_replace(chr(151), '-', $text); // emdash: —
$text = str_replace(chr(152), '~', $text); // tilde accent: ˜
$text = str_replace(chr(153), '(TM)', $text); // trademark ligature: ™
$text = str_replace(chr(154), 'sh', $text); // s Hacek: š
$text = str_replace(chr(155), '>', $text); // right single guillemet: ›
$text = str_replace(chr(156), 'oe', $text); // oe ligature: œ
$text = str_replace(chr(159), 'Y', $text); // Y Dieresis
$text = str_replace(chr(158), 'z', $text); //: ž
$text = str_replace(chr(159), 'Y', $text); //: Ÿ
$text = mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment