mysql turkish character problem

can read the database and get the correct character by using isolatin5 encoding. But when inserting a row can not insert turkish characters into table.

See https://forum.xojo.com/13897-encoding-troubles-with-2014r2

with mySQL DB ,

db.SQLExecute “SET NAMES 'utf”
dim ykod1 as string ="???i?"
dim ykod2 as string =ConvertEncoding(ykod1,encodings.utf8)
dim ykod3 as string =ConvertEncoding(ykod1,encodings.isolatin5)

db.SQLExecute(“insert into myTable set myField=’” + ykod1+"’")
db.SQLExecute(“insert into myTable set myField=’” + ykod2+"’")
db.SQLExecute(“insert into myTable set myField=’” + ykod3+"’")

none of them is working truly when inserting and update row.

but when you read the MySQL DB by select clause

ykod1=rs.Field(“myField”).StringValue.DefineEncoding(Encodings.ISOLatin5)
// this is working code and we get correct characters.

anyone knowing how to solve this problem.

You forgot the 8 in utf8:

SET NAMES 'utf8'

i forgot it to write on forum but indeed it is written as ‘UTF8’. not working

No, it is written in lower case: utf8

ok resolved,

with mySQL DB , (latin1 char set)

db.SQLExecute “SET NAMES 'utf” :// no need to do this , becouse older vers of MySql doesnt understand this.

when reading the fields from DB i encode it with isolatin5 and succesfully read the accented characters.

____________ This code is not working.
dim ykod1 as string ="???i?"
dim ykod1 as string =DefineEncoding(ykod1,encodings.utf8)
dim ykod1 as string =ConvertEncoding(ykod1,encodings.isolatin5)

sql1=“insert into someTable set fld1=’” + ykod1+"’)
db.SQLExecute(sql1)

but this one is working
--------------------------------------------------- working code
dim ykod1 as string ="???i?"
sql1=“insert into someTable set fld1=’” + ykod1+"’)

db.SQLExecute(ConvertEncoding(sql1, Encodings.ISOLatin5))
'-------------------------------------------------------