note 76564 added to function.get-html-translation-table

From: Date: Fri, 20 Jul 2007 15:43:03 +0000
Subject: note 76564 added to function.get-html-translation-table
Groups: php.notes 
Request: Send a blank email to php-notes+get-128767@lists.php.net to get a copy of this message
If you have troubles (like me) getting data from ISO-8859-1 encoded forms where user copy and paste from word, this routine could be useful. It adds to the standard get_html_translation_table the codes of the characters usually M$ Word replacs into typed text. Otherwise those characters would never be displayed correctly in html output. function get_html_translation_table_CP1252() { $trans = get_html_translation_table(HTML_ENTITIES); $trans[chr(130)] = '‚'; // Single Low-9 Quotation Mark $trans[chr(131)] = 'ƒ'; // Latin Small Letter F With Hook $trans[chr(132)] = '„'; // Double Low-9 Quotation Mark $trans[chr(133)] = '…'; // Horizontal Ellipsis $trans[chr(134)] = '†'; // Dagger $trans[chr(135)] = '‡'; // Double Dagger $trans[chr(136)] = 'ˆ'; // Modifier Letter Circumflex Accent $trans[chr(137)] = '‰'; // Per Mille Sign $trans[chr(138)] = 'Š'; // Latin Capital Letter S With Caron $trans[chr(139)] = '‹'; // Single Left-Pointing Angle Quotation Mark $trans[chr(140)] = 'Œ '; // Latin Capital Ligature OE $trans[chr(145)] = '‘'; // Left Single Quotation Mark $trans[chr(146)] = '’'; // Right Single Quotation Mark $trans[chr(147)] = '“'; // Left Double Quotation Mark $trans[chr(148)] = '”'; // Right Double Quotation Mark $trans[chr(149)] = '•'; // Bullet $trans[chr(150)] = '–'; // En Dash $trans[chr(151)] = '—'; // Em Dash $trans[chr(152)] = '˜'; // Small Tilde $trans[chr(153)] = '™'; // Trade Mark Sign $trans[chr(154)] = 'š'; // Latin Small Letter S With Caron $trans[chr(155)] = '›'; // Single Right-Pointing Angle Quotation Mark $trans[chr(156)] = 'œ'; // Latin Small Ligature OE $trans[chr(159)] = 'Ÿ'; // Latin Capital Letter Y With Diaeresis ksort($trans); return $trans; } ---- Server IP: 80.241.173.254 Probable Submitter: 217.133.114.179 ---- Manual Page -- http://www.php.net/manual/en/function.get-html-translation-table.php Edit -- https://master.php.net/note/edit/76564 Del: integrated -- https://master.php.net/note/delete/76564/integrated Del: useless -- https://master.php.net/note/delete/76564/useless Del: bad code -- https://master.php.net/note/delete/76564/bad+code Del: spam -- https://master.php.net/note/delete/76564/spam Del: non-english -- https://master.php.net/note/delete/76564/non-english Del: in docs -- https://master.php.net/note/delete/76564/in+docs Del: other reasons-- https://master.php.net/note/delete/76564 Reject -- https://master.php.net/note/reject/76564 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128767) next »