I've looked for a solution to this problem a while ago.
The MySQL documentation mention somewhere to set a parameter in the config
in order to fix it or to use "SET CHARACTER SET utf8".
I tried the config way but no matter what I tried it didn't work so I
resorted to use the query fix.
I don't understand why it's so complicated to make MySQL run in UTF-8.
Martin
On 10/15/07, Simon Mundy <[EMAIL PROTECTED]> wrote:
>
> Hi Michael
>
> That's not necessarily true regarding UTF-8 on even Linux systems.
>
> I need to tell the MySQL client in Fedora Core 6 that it needs to run
> in UTF8 before I start any queries:-
>
> $db->query('SET CHARACTER SET utf8');
>
> otherwise it will default to latin_swedish and become the weak link in
> the chain.
>
> > On 10/14/07, debussy007 <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> Like dinok said,
> >> If I use $dbquery("SET NAMES 'utf8'");
> >> I have it working.
> >>
> >> But does that still means I have garbage in my db ?
> >>
> >> Concretely I am storing the countries with their respective ISO
> >> code from a
> >> .csv file in my DB.
> >
> > Now I don't know. I've never heard of SET NAMES 'utf8'. Must be a
> > Windows thing. On *nix systems everything runs in the UTF-8 locale [1]
> > so it all Just Works. But if you have it working, you're good.
> >
> > Mike
> >
> > [1] except for the web server which usually runs in the C locale
> > because it may need to handle many encodings simultaneously.
> >
> > --
> > Michael B Allen
> > PHP Active Directory SPNEGO SSO
> > http://www.ioplex.com/
>
>
--
Martin Carpentier