Advertisement
Guest User

fixMicrosoft() // NOCHINSES FIX

a guest
Mar 6th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. function fixMicrosoft($text) {
  2.     // NOCHINSES FIX
  3.     return $text;
  4.     // First, replace UTF-8 characters.
  5.     $text = str_replace(
  6.         array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d",
  7.               "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"),
  8.         array("'", "'", '"', '"', '-', '--', '...'),
  9.         $text);
  10.     // Next, replace their Windows-1252 equivalents.
  11.     $text = str_replace(
  12.         array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)),
  13.         array("'", "'", '"', '"', '-', '--', '...'),
  14.         $text);
  15.     return $text;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement