|
Posted by Pedro Graca on 10/10/06 22:17
JoeT wrote:
> Problem is that the spanish words contain characters that are spanish
> specific, and when I read them in, they are converted into '?'.
>
> I don't want this.
> Any suggestions as to how to get around this?
Use the same character set for input and output.
If you got them as iso-8859-1 output them as iso-8859-1 (or convert)
If you got them as utf-8 output utf-8 (or convert)
<?php
$charsets = array('iso-8859', 'utf-8', 'us-ascii', 'iso-2022-jp', 'koi8-r');
$charset = $charsets[array_rand($charsets)];
header('Content-Type: text/plain; charset=' . $charset);
echo "Example of $charset\n\n\n";
for ($i=0; $i<16; ++$i) {
echo dechex($i), " :: ";
for ($j=0; $j<16; ++$j) {
echo chr($i*16 + $j);
}
echo "\n";
}
?>
Q: Why does my browser want to download this script when $charset is
"iso-8859-1"? (That is why I reverted to "iso-8859" in the script).
--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
Navigation:
[Reply to this message]
|