Page 1 of 1

mysql: best character encoding for currencies?

Posted: Wed Jun 18, 2008 4:55 am
by panic!
Does anyone know of the best collation for currency symbols.

I'm currently using utf8_unicode_ci, but after inserting my symbols they seem to come out as unrecognised characters, even the Euro symbol doesn't seem to be recognised.

Image

Any advice or pointers would be greatly appreciated.

Re: mysql: best character encoding for currencies?

Posted: Wed Jun 18, 2008 5:34 am
by onion2k
Use the html entities instead of the symbols, eg € ... much more reliable.

(unless you're sending them in emails or putting them in PDF files.. then you'll need the Western European encoding)

Re: mysql: best character encoding for currencies?

Posted: Wed Jun 18, 2008 6:50 am
by panic!
problem is a fair percentage don't have entities unfortunately :(

Re: mysql: best character encoding for currencies?

Posted: Wed Jun 18, 2008 7:01 am
by onion2k
Which ones? I can't think of any.

Re: mysql: best character encoding for currencies?

Posted: Wed Jun 18, 2008 7:21 am
by dml
For something like the Rupee sign, it would have to be utf8. The other option is a unicode escape like €, but that shouldn't be necessary.

You're nearly there. What's happening is that utf8 data has been read somewhere as something like cp1252. Make sure you're emitting a utf8 content type header, and that database connections are set up with "set names utf8".

Re: mysql: best character encoding for currencies?

Posted: Thu Jun 19, 2008 5:35 am
by panic!
Iraimbilanja

:)