Translation table not working

From: Date: Tue, 11 Sep 2001 16:08:05 +0000
Subject: Translation table not working
Groups: php.general 
Request: Send a blank email to php-general+get-66941@lists.php.net to get a copy of this message
I cannot manage correct HTML encoding, here is the example from the manual: --- $trans = get_html_translation_table(HTML_ENTITIES); $str = "Hallo & <Frau> & Krämer"; $encoded = strtr($str, $trans); The $encoded variable will now contain: "Hallo &amp; &lt;Frau&gt; &amp; Kr&auml;mer". --- If I do exactly the same, I get: "Hallo &amp; &lt;Frau&gt; &amp; Krämer" Ampersand and brackets are encoded, not the german umlaut. I tried some other chars too. Got nothing useable, some chars translated wrong. In fact just few special characters are encoded. Tested on MacOSX and Linux. Got different displays in the browser, but generally the same behavior - the translation does not work properly. If I list the translation table HTML_ENTITIES in the browser, source code shows me the correct encoding... Any tips? TIA, Peter

« previous php.general (#66941) next »