malformed trial byte or out of range char

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
erwin71
Posts: 1
Joined: Thu 24 Jan 2008 15:34

malformed trial byte or out of range char

Post by erwin71 » Wed 13 Oct 2010 19:33

hi, i'm getting this error message when i try to connect to a mysql DB on a linux host. When i try the same code on a Windows server there doesn't seem to be any probem.

because of this i think it has something to do with encoding.

can anyone help me with this issue?

iam using delphi 2010 with dbxmda 4.5.x trough 4.7 tested

AndreyZ

Post by AndreyZ » Fri 15 Oct 2010 12:02

Hello,

Specify the driver you are using: DevartMySQL, DevartMySQLDirect or DevartMySQLEmbedded?
This error appears when encoding from UTF8 string is performed. Try to catch the string which causes this error in Linux.

tam
Posts: 15
Joined: Wed 24 Nov 2010 08:07
Location: Germany

Post by tam » Wed 24 Nov 2010 08:17

Hi,

same problem here. MySQL server is running on Linux, but I didn't check if it also happens on Windows.

I'm using direcet mode and Unicode.
Try to catch the string which causes this error
Not so easy. Can you include this string into the error message?

AndreyZ

Post by AndreyZ » Wed 24 Nov 2010 13:21

We cannot include the string that causes this error into the error message because this string can contain undisplayable symbols.
Please try to do the following:
- set UseUnicode to False;
- send this string as UTF8 string to us for investigation.

tam
Posts: 15
Joined: Wed 24 Nov 2010 08:07
Location: Germany

Post by tam » Wed 24 Nov 2010 13:56

AndreyZ wrote:We cannot include the string that causes this error into the error message because this string can contain undisplayable symbols.
U can base64 encode it first. 8)
- set UseUnicode to False;
This is not possible, this error happens only several times per week, I can't really reproduce it. When it happnes next time, I try to find out, but I can't promise.

tam
Posts: 15
Joined: Wed 24 Nov 2010 08:07
Location: Germany

Post by tam » Wed 24 Nov 2010 14:32

Hi,

I forgot to mention that I'm using Delphi 2010 and MyDAC, but I think it's
the same reason as in dbExpress, isn't it?

AndreyZ

Post by AndreyZ » Wed 24 Nov 2010 15:11

To investigate the cause of this problem we need this string. Please try to catch this string and send it to us.
I forgot to mention that I'm using Delphi 2010 and MyDAC, but I think it's the same reason as in dbExpress, isn't it?
You are right, the reason is the same.

tam
Posts: 15
Joined: Wed 24 Nov 2010 08:07
Location: Germany

Post by tam » Mon 24 Jan 2011 15:14

I almost forgot to inform you, sorry. Problem solved. There was another connection which was not set to use unicode, and under certain conditions it produced this strange error msg. :oops:

AndreyZ

Post by AndreyZ » Wed 26 Jan 2011 08:41

It is good to see that this problem was solved. If any other questions come up, please contact us.

Post Reply