Re: Ongoing encoding issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave Goodchild wrote:
> Hi all, I posted a question a couple of days ago regarding a web app I have
> wherein users are able to indicated prices and concessions via a text
> field,
> and the resulting encoding issues I have experienced, the main one being
> seeing the pound sign as £ if viewing the results in a browser with the
> encoding set to Latin-1.
> 
> My question is, how do I overcome this. If I set my browser encoding to
> Latin-1 and enter the data I get that odd symbol, if I set it to UTF-8 I
> get
> clean data. Is there a way to sniff out what encoding the browser is using
> and then clean the data in any way.

check out phpinfo(); there is stuff in there telling you about what client
encoding was [probably] used.

that said you should probably opt to output everything as UTF-8 - all decent
browsers will return data in the same encoding as the page was given to them in
by default - this requires you to have php send the correct header (don't
bother with all that META tag crap), doing the following will automatically cause
the appropriate header to be sent:

ini_set('output_encoding', 'UTF-8');

> 
> I am googling for help also but you guys have been so helpful in the past I
> thought I'd try you also.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux