Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Sticky problem : MySql and UTF8
Re: Sticky problem : MySql and UTF8 [message #35224 is a reply to message #35044] Mon, 23 January 2012 22:37 Go to previous messageGo to previous message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Right way to solve the accentuated issue with MySql and UTF8 is to add the following code after getting the connection:

mysql_set_character_set(MySession,"utf8");

Operations of insertion must be done as follows:

String str = ToCharset(CHARSET_UTF8,AsString(~MyEditString),GetDefaultCha rset(),'?');
SQL &Insert(MYTABLE)(NAME,str)(NUM,MyEditInt.GetData());


Operations of deletion must ne done as follows:

SQL &Delete(MYTABLE).Where(NAME==ToCharset CHARSET_UTF8,~MyEditString,GetDefaultCharset(),'?'));

I will try to post a code snippet to explain in details how to proceed with MySql and UTF8 encoded tables.

Hoping this will be helpful for someones

Biobytes
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Added partial support for ODBC output parameters, but the solution is ugly
Next Topic: MSSQL, default DB, datetime
Goto Forum:
  


Current Time: Tue May 14 18:53:14 CEST 2024

Total time taken to generate the page: 0.02034 seconds