Get Trash Instead Umlaut letter from DB.
Get Trash Instead Umlaut letter from DB.
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.
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.
special german chars umlaut
Hello,
i try this
http://www.devart.com/forums/viewtopic.php?t=23624
but it doesn`t help with mysqldump or mysqlscript.
I use mysqldump to backup a file in the file all characters ok. I can connect to the same server and try to restore and the letters are not ok.
Mysqlloader have no problem.
I use Mysql Server Version 4.0.24.
Thank you for help
i try this
http://www.devart.com/forums/viewtopic.php?t=23624
but it doesn`t help with mysqldump or mysqlscript.
I use mysqldump to backup a file in the file all characters ok. I can connect to the same server and try to restore and the letters are not ok.
Mysqlloader have no problem.
I use Mysql Server Version 4.0.24.
Thank you for help
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Hi,
show variables like 'char%'
charset latin1
charsets latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5
if i try unicode = true i got an exception, charset differs from the server, set charset to latin1.
thanks
Denker
show variables like 'char%'
charset latin1
charsets latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5
if i try unicode = true i got an exception, charset differs from the server, set charset to latin1.
thanks
Denker
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
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?
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?
sry that was my fault, i used streamreader and streamwriter to edit the File, and there was my fault, that the streamreader and streamwriter used a wrong encoding text. now it`s all ok.
I edit the file, so i can replace or ignore duplicate id, and now it`s ok.
Thank you
I edit the file, so i can replace or ignore duplicate id, and now it`s ok.
Thank you
Code: Select all
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