mysql: best character encoding for currencies?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

mysql: best character encoding for currencies?

Post 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.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: mysql: best character encoding for currencies?

Post 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)
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: mysql: best character encoding for currencies?

Post by panic! »

problem is a fair percentage don't have entities unfortunately :(
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: mysql: best character encoding for currencies?

Post by onion2k »

Which ones? I can't think of any.
dml
Forum Contributor
Posts: 133
Joined: Sat Jan 26, 2008 2:20 pm

Re: mysql: best character encoding for currencies?

Post 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".
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: mysql: best character encoding for currencies?

Post by panic! »

Iraimbilanja

:)
Post Reply