List:General Discussion« Previous MessageNext Message »
From:Warren Young Date:May 24 2005 8:00pm
Subject:Re: unicode and C API
View as plain text  
Patrice Serrand wrote:

>     mysql_query (mysql, "INSERT INTO db_unicode.unicode_tbl VALUES (6, _utf8
> 'atüpedâ' COLLATE utf8_general_ci)");

I'm no Unicode expert, but I've never seen that _utf8 bit before.  What 
is it?  Or more accurately, what do you expect it to do?  I ask because 
that string is probably already in UTF-8 form, if your text editor is 
UTF-8 aware.  The common Unix text editors are, as is the editor in the 
Visual Studio IDE.

I've done very similar things with MySQL++, the C++ wrapper for the C 
API, which I maintain.  No _utf8 stuff 
was required.  Check out examples/resetdb.cpp and examples/custom3.cpp 
in the distribution.

> Everything works like if the C API only accepts ANSI strings.

Nonsense.  All the C API cares about are null-terminated C strings, 
which UTF-8 data is.
unicode and C APIPatrice Serrand24 May
  • Re: unicode and C APIWarren Young24 May