Re: problem with currency signs

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

 



Angelo:

Now might be the time to start looking at Unicode characters.

Here's a start:

http://www1.tip.nl/~t876506/utf8tbl.html

There's all sorts of ways to show special characters.

For example, the BULLET (Unicode 2022) can be shown by:

•
•
&#8226;   <-- Note

Please note that "8226" is DEC for the HEX value of 2202 (Unicode code point for BULLET). As such, if you find the Unicode code point for the character you want, all you have to do is: 1) to convert it to DEC; 2) add the prefix of "&#" and the suffix of ";" 3) and you'll have a character that will be shown in browsers.

So, my advice would be to store the DEC value of the currency label and not worry about comparing glyphs, which may not be consistent across browsers and OS's. Whereas, Unicode will be consistent.

tedd

---


Hi guys,

Im having problems with the Euro and Pound currency signs and storing them etc...

here is my scenario. I have a menu/list of currencies available for selection, HTML below for the signs:

$
&pound;
&euro;

When listed in the browser they show fine.
When I want to save them, they are saved as the actual sign in the DB and not the HTML code for the symbol, which isnt a train smash, however, when I try compare the values in the DB with the predefined list of currency symbols, I get some problems.

The below if statement doesnt seem to resolve:


if ($row['p_currency'] == "¤") //where ¤ is also the value in the DB


even if the value is ¤, or &euro; it still never reverts to true...

So is there a special way I should be treating the symbols and maybe a special way I should be storing them? or comparing them?

thanks in advance


--

Angelo

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


--
--------------------------------------------------------------------------------
http://sperling.com/

--
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