1

I would like to display a couple of currency codes in php but cannot seem to get it working. PHP script is encoded in utf-8, which is also the charset used in HTML:

doctype: <!DOCTYPE html> meta: <meta charset="UTF-8">

Viewed in Firefox with no specific encoding setting.

Currency symbol examples would be :

(1) U+20BC and (2) &#1423;

I tried to adapt several of the solutions to other questions which sounded as if they could apply but to no avail. I have trouble getting my head around the whole unicode concept.

Thanks for your help

Argoron
  • 749
  • 2
  • 10
  • 26
  • What is the output when you just print them out? `echo "₼";` (after changing the format) and `echo "֏";` – Petr Hejda Mar 26 '16 at 22:38
  • @PetrHejda Both appear as these tiny squares containing characters "20BC" and "058F" respectively – Argoron Mar 26 '16 at 22:41
  • It most likely means the browser is interpreting the HTML in different encoding than UTF-8. Can you post the meta tag that you use to define charset, and doctype (if defined)? You can also check in your browser (could be somewhere like View -> Encoding in the browser menu) whether it tells what encoding it uses to display the page. – Petr Hejda Mar 26 '16 at 22:48
  • 1
    The manat symbol was added in Unicode 7.0, which is relatively recent. It's quite possible that the font in use does not support it. – nj_ Mar 26 '16 at 22:59
  • @PetrHejda edited the question to include the info – Argoron Mar 26 '16 at 23:02
  • @nj_ This would be a font issue ? The one I'm using Helvetica Neue. Are there fonts which do include all the latest symbols ? Which one would be safest for displaying these symbols then ? – Argoron Mar 26 '16 at 23:04
  • @Argoron The meta and doctype seems correct. But nj_ has a point. This is not exactly my field of expertise, so i won't be able to help any further into the topic, but i would suggest looking into the font issue. – Petr Hejda Mar 26 '16 at 23:05
  • @Argoron There are some fonts that [support](http://www.fileformat.info/info/unicode/char/058F/fontsupport.htm) [both](http://www.fileformat.info/info/unicode/char/20BC/fontsupport.htm) characters you've mentioned, but most of these aren't going to be universally available. If it is indeed a font issue, then it leaves you with 2 options really: [load a supporting font from a remote location](https://developer.mozilla.org/en/docs/Web/CSS/@font-face) or fake it with an image/sprite. – nj_ Mar 26 '16 at 23:57

0 Answers0