Re: Encoding issue with £
| From: | Jochem Maas | Date: | Wed, 24 Jan 2007 15:58:51 +0000 |
| Subject: | Re: Encoding issue with £ | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247704@lists.php.net to get a copy of this message | ||
Dave Goodchild wrote:
> This may be more of a mysql issue, but I am using php for my app so here
> goes...
>
> I have a fee field in the database, and when users post events they can
> specify entrance fee in £. In some, not all, of the fields I am getting,
> for
> example, £7 rather than £. Is this an encoding issue?
>
> Many thanks in advance...
>
as a sidenote (won't help to fix the current encoding issues outright):
currency values should be stored in the DB as integers (i.e. as penny based values).
no floats (so that you avoid any rounding errors) and definitely no currency symbols!
(if you need to store which currency the
price/ammount is in then use a seperate field (and don't use the symbol, instead use the
currency
ISO code - many currencies share a common symbol!)