Re: Text encoding

From: Date: Tue, 28 Mar 2006 01:09:34 +0000
Subject: Re: Text encoding
Groups: php.general 
Request: Send a blank email to php-general+get-232691@lists.php.net to get a copy of this message
At 5:47 PM -0600 3/27/06, David.Martinez@eurorscg.com wrote:
Hi everybody. I'm currently using a PHP script to download messages through a POP3 connection (with fsockopen()). Messages are pooled and classified into my application (a help desk manager). As long as we use a lot of accents in spanish: á, é, í, ó, ú, ñ; those characters appears as =F1, =E9, =ED, =F3, etc. What type of encoding is it ? Which PHP function should I use to decode it ?
David: After some thought, the chr() may be limited to ASCII, which ends at 7F (127 dec). You may be able to work with the "Extended ASCII" codes which go up to 255 -- however, the characters vary between OS -- thus the "Extended ASCII" because it's not really ASCII. --- I previously said: David: The encoding is Unicode code points. 00F1 is HEX for ñ 00E9 is HEX for é 00ED is HEX for í and so on. To decode, it's: <?php $result = chr(hexdec(<whatever HEX value)); echo $result; ?> However, to display it, you have to have a font capable of displaying the code point. HTH's tedd -- -------------------------------------------------------------------------------- http://sperling.com

« previous php.general (#232691) next »