Encoding troubles with 2014r2

Event without “set names utf8” on both releases?

When I set the db up as UTF-8 and insert UTF-8 data and navicat gets the display wrong that tells me it has no clue how to handle it.
And yes even in 2014r1.1 with the db set to be latin1 and no set names utf8 it still gets it wrong.

The ONLY way it works with either release and displays the same data in Navicat is to do

dim sql as string = "insert into MyTable( MyString ) values ('') " db.SQLExecute( ConvertEncoding(sql, Encodings.ISOLatin1) )

which is still not what you’re doing

I literally have no idea how it ever worked for you because your code is not correct

Hello there,

i do have exactly the same issue with r2.
my code went well over years, and i am encoding and decoding every text fetched and received by the mysql database.
Text ist still displayed right, but saving into the database saves wrong encoding. On Mac and Windows.

to encode (Save in database):
MyText=DefineEncoding(ThisText, Encodings.UTF8)
MyText=ConvertEncoding(MyText, Encodings.WindowsLatin1)

to decode (read from database):
MyText=DefineEncoding(ThisText, Encodings.WindowsLatin1)
MyText=ConvertEncoding(MyText, Encodings.UTF8)

best,
Stephan

Thank you again everybody for your answers!

Today, I restarted my computer, replaced the MySQLCommunityPlugin of 2014r2 by the one of 2014r1.1, build my app and IT WORKS!

It’s really curious because then, I put back the MySQLCommunityPlugin of 2014r2 and my app still works…

Hope that this problem will not come back…

Oups mistake, with the MySQLCommunityPlugin of 2014r2, it still won’t work!

After many other tries, I can say that the problem is linked to a change in the MySQLCommunityPlugin.

When I use the plugin of the release 2014r1.1 in XOJO 2014r2, I have no problem.

As soon as I try to use the one of the release 2014r2, it doesn’t work.

I’m gonna use the plugin of the previous version, waiting for an answer from XOJO.

[quote=111996:@SbastienAngot]<…>
I’m gonna use the plugin of the previous version, waiting for an answer from XOJO.[/quote]

Do you have opened a Feedback case? If you provide a project with reproducible steps showing a bug, then you may have a chance that the issue gets addressed. Otherwise you can wait long for an answer, I’d say.

Thanks for your suggestion Oliver, I forgot that…

So I added a new case in the Feedback app : 34476 - MySQL Encoding Issue in XOJO 2014r2

It is now fixed, it seems that there was «something» with the 2014r2!

I’m not sure if this is the cause

use db.SQLExecute( “set names ‘utf8’” )

instead of db.SQLExecute( “set names ‘utf-8’” )

Yes, it should be utf8 and not utf-8.

Actually, my problem was solved with the next releases of XOJO, there had to be an issue with the one I used when I encountered the problem.

Now it’s ok, thanks everybody for your answers!

I very much doubt that this is the real reason there must be something else going on. I have two MySQL related applications and I compile them with the last RB version (for Snow Leopard installations in our company) and the current Xojo version and there are no encoding problems.

I’m not talking about an issue with «Real Basic», I just say that I installed a new release of XOJO with which I encountered this encoding issue, and when XOJO published the next release, the problem was solved.

Don’t count on that. You should check in the Xojo release notes if you find some bug fixes related to encoding and the MySQL client. If find you nothing, it means that you had just luck – it is not good to not know why something suddenly works. Very dangerous in the long run.