Charset problems with MySQL

Hi,

I have a MySQL DB with the charset UTF_general_ci.
I thought this is the most common charset, which also works with german special charachters.

Now, when I select some string from the DB (“select * from tablename;”) and insert them into a listbox (“listbox.cell(1,1) = data.IdxField(1).StringValue”) I get the following error, when there are special chars like ", , , ".

[quote]Unhandled RuntimeException
Message: Encountered invalid character.

Stack:

xojo.Data.GenerateJSON%y%x
WebResponse._Render%s%o
WebSession._HandleEvent%%oso<_HTTPServer.HTTPRequestContext>
WebSession._HandleRequest%i4%oso<_HTTPServer.HTTPRequestContext>
WebApplication._HandleHTTPRequest%%oo<_HTTPServer.HTTPRequestContext>
_HTTPServer.HTTPRequestThread.Event_Run%%o<_HTTPServer.HTTPRequestThread>[/quote]

Can anyone help me?

data.IdxField(1).StringValue").DefineEncoding(Encodings.Latin...)

how can I set this global?

While opening the Database, you could use a direction like default_charset = "utf-8"; for example.

Lars,

I have had a lot of problems with umlauts in the past.
If you still have problems use this sql command first before retrieving data from database:

 "SET NAMES 'UTF8'" 

Best Thomas

Thank you Thomas. I was’nt at my Desk and wrote (the wrong direction) from my mind. :wink:

The world would be so much better if everything was UTF8.
(Oh, and also world peace and free beer of course)