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 » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Fixed MySQL encoding issue
Fixed MySQL encoding issue [message #17548] Wed, 20 August 2008 12:10 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I have encountered problem with text encoding in MySQL.

This is now fixed; MySql package performs necessary conversion to default encoding.

However, this needs reconsideration of BLOBs in database (because they must NOT be converted). On fetch, U++ can deal with problem, but sending data to MySQL you have to embed it to SqlRaw helper type (just like in Oracle).

(Note that everything works by setting MySQL to utf-8 mode, therefore if your application is in utf-8 too, there is no conversion and no BLOB issue).

Mirek
Re: Fixed MySQL encoding issue [message #17558 is a reply to message #17548] Wed, 20 August 2008 18:17 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Great.
Could you please tell, does any of MySQL classes set session character set?
Re: Fixed MySQL encoding issue [message #17560 is a reply to message #17558] Wed, 20 August 2008 19:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Wed, 20 August 2008 12:17

Great.
Could you please tell, does any of MySQL classes set session character set?


Yes:

http://code.google.com/p/upp-mirror/source/browse/trunk/upps rc/MySql/MySql.cpp

Mirek
Re: Fixed MySQL encoding issue [message #17561 is a reply to message #17560] Wed, 20 August 2008 19:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
(or no? Smile now thinking about it, I am not sure about the term....

Anyway, I think, please check the code and explain if it is wrong..
Re: Fixed MySQL encoding issue [message #17571 is a reply to message #17561] Thu, 21 August 2008 08:33 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Yes, I saw it now. This is strange, but I had issues with encoding until I explicitly called :
	if (!session.Connect(config.GetAdd("mysqlLogin","?"),config.GetAdd("mysqlPassword","?"),config.GetAdd("mysqlDB","?"),config.GetAdd("mysqlServer","?"),3306))
		throw "Can`t connect to MySQL";
	mysql_set_character_set(session, "utf8");


My issue was the same as here.
And changing program charset and encoding with SetLNGCharset or SetLanguage didn`t seem to help.

[Updated on: Thu, 21 August 2008 08:35]

Report message to a moderator

Re: Fixed MySQL encoding issue [message #17576 is a reply to message #17571] Thu, 21 August 2008 11:42 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, I call 'mysql_set_character_set' too...

In any case, it now works...

Mirek
Previous Topic: Topic++ converted to new format with "includeable" option
Next Topic: Random, Random(dword)
Goto Forum:
  


Current Time: Fri Mar 29 12:11:19 CET 2024

Total time taken to generate the page: 0.02232 seconds