How do i solve a different behavior between the Developer and a client?
I have a solution that is transfering data between a local Sybase solution and a remote one (web pubbliched) that use a MySQL backend.
They have both a UTF-8 charset collation.
Well, if i transer text data using Servoy developer it works pretty well, while using Servoy client the fields get truncated as soon as there is an accented letter.
Wandering if it could be Java related.
Servoy R2 2.2.7-build 339
Are you sure your MySQL tables are really using UTF8? In MySQL you can define the charset at different levels: system, server, database, table.
Try this in MySQL client:
show create table <yourtablename> ;
if the table is really using UTF8 the output should end like this:
ENGINE=InnoDB DEFAULT CHARSET=utf8
If not you can change the table charset using an ALTER TABLE statement.
ngervasi:
Are you sure your MySQL tables are really using UTF8?
…
ENGINE=InnoDB DEFAULT CHARSET=utf8
Hi Nicola.
Yes that’s what SHOW CREATE TABLE say.
The strangeness of Servoy here is the different behavior from the Developer (where i get no problem) to the client (where instead the field is truncated at the first accented char).
Thanks.
AGhisalberti:
Well, if i transer text data using Servoy developer it works pretty well, while using Servoy client the fields get truncated as soon as there is an accented letter.
But what do you mean when you say “transfer data”?
ngervasi:
but what do you mean when you say “transfer data”?
Grabbing text from a field of the local SyBase and inserting it into the remote MySQL database.
This data transfer is executed through a method:
relation_to_remote_mysql.my_textfield = my_textfield;
Did you try using a client on another machine? Maybe the problem is linked only to that machine’s client.
Anyway try to clean the Java Webstart Cache and trash the “.servoy” folder inside your home folder and download a fresh client.
ngervasi:
Did you try using a client on another machine? Maybe the problem is linked only to that machine’s client.
Yes. The problem came out yesterday from a client running on a PC box, i am on a Mac.
ngervasi:
Anyway try to clean the Java Webstart Cache and trash the “.servoy” folder inside your home folder and download a fresh client.
Ok, just done it. The problem remains. ![Sad :(]()
Now I’m quite confused.
You have a Servoy Server and 2 dataproviders, 1 MySQL and 1 Sybase, right?
You said Developer on Mac is working fine but Client on windows is not.
How do you connect to the servoy server with your developer from your mac?
Please, explain carefully your setup.
Ah, i didn’t mention before that when the method comes to the end on Servoy i can see the remote text field (the local one is placed closed to the remote one) and it appears as properly filled.
But as i try to see it through the browser (firefox, Explorer… whatever) i get no text after the accented char. Querying the MySQL database with another tool the field seems to be truncated as well.
Let’s say:
“Nuova unità immobiliare” in the MySQL becomes
"Nuova unit "
AGhisalberti:
Ah, i didn’t mention before that when the method comes to the end on Servoy i can see the remote text field (the local one is placed closed to the remote one) and it appears as properly filled.
But as i try to see it through the browser (firefox, Explorer… whatever) i get no text after the accented char. Querying the MySQL database with another tool the field seems to be truncated as well.
The problem is not Servoy but your web interface (I guess PHP) probably it’s not configured to use UTF8, it’s the same thing that happens if you use mysql client on the CLI to access a UTF8 table. Try to google “PHP UTF8 MYSQL”. If Servoy displays the data correctly it means that the data is correctly stored on the DB and the problem is how your PHP is fetching it.
ngervasi:
Now I’m quite confused.
You have a Servoy Server and 2 dataproviders, 1 MySQL and 1 Sybase, right?
I have:
A. Local machine (Win Server 2003) running Sybase and 1 Servoy Server;
B. Remote machine (Win Server 2003) running MySQL (no Servoy here). This machine is serving up a web site.
In servoy is builded a solution that keep tracks of both the databases.
On request some data is extracted from the A.Sybase and is sent to B.Mysql, to be pubblished on the web.
ngervasi:
You said Developer on Mac is working fine but Client on windows is not.
How do you connect to the servoy server with your developer from your mac?
The clients are having troubles both from Mac and PC.
Actually there is a difference between the connection established from my Developer and the one from the client. The Developer connect directly to the databases, while the clients are (i guess) connected to the backends through the Servoy Server.
AGhisalberti:
Actually there is a difference between the connection established from my Developer and the one from the client. The Developer connect directly to the databases, while the clients are (i guess) connected to the backends through the Servoy Server.
This is going to be complicated to explain.
Contact me via Skype.
ngervasi:
The problem is not Servoy but your web interface (I guess PHP) probably it’s not configured to use UTF8, it’s the same thing that happens if you use mysql client on the CLI to access a UTF8 table. Try to google “PHP UTF8 MYSQL”. If Servoy displays the data correctly it means that the data is correctly stored on the DB and the problem is how your PHP is fetching it.
Uhm, it should not be PHP. When i execute the method from the Developer any char is correctly inserted and properly displayed on the web page.
This problem only happens with text inserted by the Servoy client.
I probably haven’t been clear before. Servoy client only seems to insert all the text correctly, but in fact it’s not. If i quit the client and then re-open it at the same record - now - i see that the remote field is truncated.