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 » umlauts in mysql-update
umlauts in mysql-update [message #22211] Wed, 24 June 2009 15:37 Go to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
I've updated from 2008.1 to 1314 and since i did this, i have a problem when updating a mysql-database:

When i use umlauts in that mysql-update, every umlaut is displayed as ?

Updating a mysql-database using umlauts was no problem with 2008.1.

Is this a known problem and how can i fix this?
Re: umlauts in mysql-update [message #22214 is a reply to message #22211] Wed, 24 June 2009 16:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
michael wrote on Wed, 24 June 2009 09:37

I've updated from 2008.1 to 1314 and since i did this, i have a problem when updating a mysql-database:

When i use umlauts in that mysql-update, every umlaut is displayed as ?

Updating a mysql-database using umlauts was no problem with 2008.1.

Is this a known problem and how can i fix this?


Do you have correct encoding mode?

Mirek
Re: umlauts in mysql-update [message #22215 is a reply to message #22214] Wed, 24 June 2009 18:29 Go to previous messageGo to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
I've set encoding in the package-organizer to windows-1252, as i did in the 2008.1 version of upp.

Is this the right place to set the encoding?
Re: umlauts in mysql-update [message #22224 is a reply to message #22215] Thu, 25 June 2009 20:11 Go to previous messageGo to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
The problem seems to be somewhere in SqlUpdate:

customer customer;
		
customer.sqlID = StrInt(sqlData[0]);
customer.name = sqlData[1];
customer.number = StrInt(sqlData[2]);
customer.product = sqlData[3];
customer.version = sqlData[4];
customer.location = sqlData[5];
customer.connection = sqlData[6];
customer.comment = sqlData[7];
		
PromptOK(customer.name); // Just for debugging
		
Sql sql(session);
		
sql * SqlUpdate(SqlId(sqlTable))
(NAME, customer.name)
(NUMMER, customer.number)
(PRODUKT, customer.product)
(VERSION, customer.version)
(STANDORT, customer.location)
(ANBINDUNG, customer.connection)
(BEMERKUNG, customer.comment)
.Where(ID == customer.sqlID);


customer.name contains umlauts as long i update the database with SqlUpdate.

Any idea whats going wrong? As i mentioned before, this problem does not occur using upp 2008.1.
Re: umlauts in mysql-update [message #22235 is a reply to message #22224] Fri, 26 June 2009 14:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
michael wrote on Thu, 25 June 2009 14:11

The problem seems to be somewhere in SqlUpdate:

customer customer;
		
customer.sqlID = StrInt(sqlData[0]);
customer.name = sqlData[1];
customer.number = StrInt(sqlData[2]);
customer.product = sqlData[3];
customer.version = sqlData[4];
customer.location = sqlData[5];
customer.connection = sqlData[6];
customer.comment = sqlData[7];
		
PromptOK(customer.name); // Just for debugging
		
Sql sql(session);
		
sql * SqlUpdate(SqlId(sqlTable))
(NAME, customer.name)
(NUMMER, customer.number)
(PRODUKT, customer.product)
(VERSION, customer.version)
(STANDORT, customer.location)
(ANBINDUNG, customer.connection)
(BEMERKUNG, customer.comment)
.Where(ID == customer.sqlID);


customer.name contains umlauts as long i update the database with SqlUpdate.

Any idea whats going wrong? As i mentioned before, this problem does not occur using upp 2008.1.


Aehm, and when things get broken?

Anyway, the difference (since 2008.1) seems to be in these lines:

	if(mysql && mysql_real_connect(mysql, sEmpNull(host), sEmpNull(user),
	                               sEmpNull(password), sEmpNull(database), port,
	                               sEmpNull(socket), 0)) {
		Sql sql(*this);
		username = sql.Select("substring_index(USER(),'@',1)");
		mysql_set_character_set(mysql, "utf8");
		sql.Execute("SET NAMES 'utf8'");
		sql.Execute("SET CHARACTER SET utf8");
		return true;
	}


..and then there is code to convert results from UTF-8 to/from actual encoding...

Maybe you could try to set your app to utf-8 and see what happens?

Mirek
Re: umlauts in mysql-update [message #22245 is a reply to message #22211] Fri, 26 June 2009 21:10 Go to previous messageGo to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
I set my app-encoding to utf-8, but the problem is still there.
Re: umlauts in mysql-update [message #22248 is a reply to message #22224] Sat, 27 June 2009 10:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
michael wrote on Thu, 25 June 2009 14:11

The problem seems to be somewhere in SqlUpdate:

customer customer;
		
customer.sqlID = StrInt(sqlData[0]);
customer.name = sqlData[1];
customer.number = StrInt(sqlData[2]);
customer.product = sqlData[3];
customer.version = sqlData[4];
customer.location = sqlData[5];
customer.connection = sqlData[6];
customer.comment = sqlData[7];
		
PromptOK(customer.name); // Just for debugging
		
Sql sql(session);
		
sql * SqlUpdate(SqlId(sqlTable))
(NAME, customer.name)
(NUMMER, customer.number)
(PRODUKT, customer.product)
(VERSION, customer.version)
(STANDORT, customer.location)
(ANBINDUNG, customer.connection)
(BEMERKUNG, customer.comment)
.Where(ID == customer.sqlID);


customer.name contains umlauts as long i update the database with SqlUpdate.


Please, again, when it gets wrong?

Mirek
Re: umlauts in mysql-update [message #22249 is a reply to message #22211] Sat, 27 June 2009 11:04 Go to previous messageGo to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
lets say for exapmle the customer.name contains umlauts like this:

Müller

PromptOK(customer.name); // Everythins is fine, customer.name is still Müller
		
Sql sql(session);
		
sql * SqlUpdate(SqlId(sqlTable)) // <-- here the customer.name changes to M?ller
(NAME, customer.name)
(NUMMER, customer.number)
(PRODUKT, customer.product)
(VERSION, customer.version)
(STANDORT, customer.location)
(ANBINDUNG, customer.connection)
(BEMERKUNG, customer.comment)
.Where(ID == customer.sqlID);
Re: umlauts in mysql-update [message #22256 is a reply to message #22249] Sun, 28 June 2009 09:10 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
michael wrote on Sat, 27 June 2009 05:04

lets say for exapmle the customer.name contains umlauts like this:

Müller

PromptOK(customer.name); // Everythins is fine, customer.name is still Müller
		
Sql sql(session);
		
sql * SqlUpdate(SqlId(sqlTable)) // <-- here the customer.name changes to M?ller
(NAME, customer.name)
(NUMMER, customer.number)
(PRODUKT, customer.product)
(VERSION, customer.version)
(STANDORT, customer.location)
(ANBINDUNG, customer.connection)
(BEMERKUNG, customer.comment)
.Where(ID == customer.sqlID);



Have you checked what is in MySQL? (using some other tool, e.g. MySql Query Browser)?

Would it be possible to chreate short testcase?

Mirek
Previous Topic: How to create a sqlite3 function
Next Topic: ExportSch, zero byte file is the result
Goto Forum:
  


Current Time: Thu Apr 18 06:05:17 CEST 2024

Total time taken to generate the page: 0.02248 seconds