im really getting in trouble with mysql and encodings for more than a month meanwhile. So I really hope, anyone can help.
My problem: I have to read a csv file into a listbox. Next step is to define separators and columns. One click to the “header line” of the csv is used to generate columnnames, which I use for defining the headings of the listbox. Nothong complicated up to this moment…
My last step is creating a MySQL file using sql.execute like
[code] sqlstring = sqlstring + " CREATE table IF NOT EXISTS “+”
x"+ WinCustomer.TFid.Text+"_"+TFfileName.Text+" “+”(" _
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, "
// Columns from headings
for i = 0 To lbi.ListCount-1
if lbi.CellState(i,1) = Checkbox.CheckedStates.Checked Then
sqlstring = sqlstring+"
"+ lbi.Cell(i, 0)+" VARCHAR(100), "
sqlstring = sqlstring + "
Output VARCHAR (400))"[/code]
In debugger a string (UTF-8) with someting something like
CREATE table IF NOT EXISTS
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
Output VARCHAR (400))
has been created. In my next line of code I use it with db.sqlexecute(sqlstring) to create the table.
Now the strange part making me crazy: when I copy that string into mysql workbench for creating the table “by hand” everything works fine
When I´m letting xojo doing this for me wit “db.sqlexecute(mysqlstring” my columnnames are getting special characters like that table description below
id int(11) PK AI
What difference makes copy and paste or directly from xojo? Why is there that f… ï»¿ in my column name?
I really need help - my next escalation level will be slitting my wrists (just kidding - hopefully)
Thanks in advance