Unicode - do I/don't I??

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

georgeoc
Forum Contributor
Posts: 166
Joined: Wed Aug 09, 2006 4:21 pm
Location: London, UK

Post by georgeoc »

Is that true that the fudging is only needed on creating the tables? Not every time the app opens a connection to a database?

I'm happy to keep all user admin control panel stuff to ASCII - no problem with that. My worries are when I come to importing an email from a POP mail box, for example, and converting it into a PDF, a phpBB forum post, or whatever. That's the kind of challenge I'm talking about. Although, from your post it seems like it may not be as impossible as I thought.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

There's a separate set of fudging that happens while creating the database, sorry. Early versions of MySQL don't support having their character encoding specified in CREATE table calls.
georgeoc
Forum Contributor
Posts: 166
Joined: Wed Aug 09, 2006 4:21 pm
Location: London, UK

Post by georgeoc »

But when I connect to the db each time, to add or retrieve data? Do I need to specify UTF-8 when connecting?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Yes, unless, as I mentioned before, you're storing the UTF-8 data in a binary column. You could even use varchar with binary.
georgeoc
Forum Contributor
Posts: 166
Joined: Wed Aug 09, 2006 4:21 pm
Location: London, UK

Post by georgeoc »

OK. Thanks so much for your help and patience. Wish me luck!
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Good luck!
Post Reply