Hello. I have DB with umlaut letters. Db is MySQL 3.23.45. Default charset is latin1. When I get data using Devart dotConnect. I get trash instead umlaut letter.
What I should change to get valid letters?
I was trying to change charset in connection string to latin1. It is not help, I get exception "Client character set 'utf8' is different from server character set 'latin1'.".
If change to utf8 It gets exception. I was trying set Unicode=true in connection string and in connection object in code. But I get exception like "Client character set 'utf8' is different from server character set 'latin1'."
How to read umlaut letter?
P.S. Server Explorer in VS2010 not read umlaut letters too when I use dotConnect.
Synchronization of client and server encoding could be made by setting the Charset property of the MySqlConnection object (or the Character Set option in the connection string) to 'auto'. In this case, the server asks for the charset and sets the appropriate charset on the client. Does it help?
Could you please specify the following:
1. Your system default charset (it can be found with the help of the toolbar -> Region and Language on the Administrative tab. The language is specified on this tab in the Current language for non-Unicode programs section);
2. Both of your connection strings (roughly, without credentials) for backup and restore;
3. The snippet of code where you perform backing up;
4. The snippet of code where you perform restoring. Do you use the name of a file or a Stream object?
If you perform the backup and restoring with one connection in the same application do you have "all characters ok" in the file and "the letters are not ok" in the database after restoring?
Public Function tabellensync(ByVal table As String, Optional ByVal whereklausel As String = "", Optional ByVal auswahl As String = "*", Optional ByVal ignore As String = " IGNORE ") As Boolean Dim sr As System.IO.StreamReader Dim sw As System.IO.StreamWriter Dim neu As String Dim datei As String datei = "C:\ticket_sync\" & table & Now.Ticks & ".sql" tabellensync = True dumpsave.IncludeDrop = True dumpsave.GenerateHeader = True dumpsave.Connection = conentfernt dumpsave.UseExtSyntax = True dumpsave.QuoteIdentifier = True dumpsave.BackupQuery("select " & auswahl & " from " & table & " " & whereklausel, datei) sr = New System.IO.StreamReader(datei) neu = sr.ReadToEnd sr.Close() 'with ignore i ignore duplicate id`s and with the second i Replace duplicate then is ignore = " REPLACE " If ignore = " IGNORE " Then neu = Replace(neu, "INSERT INTO", "INSERT " & ignore & " INTO") Else neu = Replace(neu, "INSERT INTO", ignore & " INTO") End If
sw = New System.IO.StreamWriter(datei) sw.Write(neu) sw.Close() conlokal.open() AddHandler dumpeinspiel.[Error], New Devart.Common.ScriptErrorEventHandler(AddressOf dump_error) dumpeinspiel.Connection = conlokal dumpeinspiel.Restore(datei) My.Computer.FileSystem.DeleteFile(datei) Return 1 End Function