Bug #5990 wchar_t support in C API missing
Submitted: 8 Oct 2004 21:03 Modified: 11 Nov 2004 21:03
Reporter: Bernd Prager Email Updates:
Status: No Feedback Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.0 OS:Any (any)
Assigned to: CPU Architecture:Any

[8 Oct 2004 21:03] Bernd Prager
MYSQL now supports UTF8 as of version 4.1.0. 
The C API still returns data as arrays of "char" strings.

How to repeat:
Try implementing wchar_t  string results in client code.

Suggested fix:
Update C API to "wchar_t" strings.
[9 Oct 2004 10:41] Konstantin Osipov
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
[9 Oct 2004 10:43] Konstantin Osipov
Please ignore the previous reply.
You can fetch and bind and utf8 data using the C API now.
How do you propose support for wchar_t to be implemented?
[9 Oct 2004 10:46] Konstantin Osipov
We can't just replace char * with wchar_t * everywhere - not all C API users need it.
[11 Oct 2004 13:56] Bernd Prager
I don't know if this is the best way but 
a solution could be the introduction of a data type like:

struct my_string
     bool isWchar;
       char * charString;
       wchar_t * wcharString;
[11 Oct 2004 20:33] Konstantin Osipov
And what are benefits of adding wchar_t support to the API?
Isn't it easier to have just one application-level function "convert_char_to_wchar_t"?
The server doesn't use wchar_t at this point anyway, so hiding this work inside the library won't give any noticable benefit.
What do you think?
[11 Oct 2004 21:03] Bernd Prager
I didn't know that the server doesn't use UTF8 internally yet.
Does that mean that the Unicode string on the server is currently represented as a stream of standard char bytes?
Then you're right. A simple conversion routine would be sufficient and I think helpful too.
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".