how I input Hebrew from winForm to mySql
-
when i insert hebrew on mySql it goes well but when trying to pest hebrew data from winForm is I get "???" :sigh:
-
when i insert hebrew on mySql it goes well but when trying to pest hebrew data from winForm is I get "???" :sigh:
That's probably more to do with how you are retrieving and displaying it than anything else: "Hebrew" is a part of a characters set, and not all sets will contain the appropriate glyphs for it to display correctly. When it doesn't, one of the displays you get is '?' to indicate it. The big possibility is that you are storing them in a non-UNICODE column in your DB: If it's NVARCHAR it's OK, if it's VARCHAR then it won't work correctly. So start by doing "test inserts": use your existing code to insert a "known good" Hebrew phrase string to SQL, and simultaneously convert it to a byte array:
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(myHebrewString);
Then retrieve the same string from the DB (using your existing code) and convert that to a byte array as well. Compare the strings, and compare the byte arrays. If they are the same then the DB and the store / restore code is fine, so you need to start looking at your display code. Sorry, but we can't do any of that for you!
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
That's probably more to do with how you are retrieving and displaying it than anything else: "Hebrew" is a part of a characters set, and not all sets will contain the appropriate glyphs for it to display correctly. When it doesn't, one of the displays you get is '?' to indicate it. The big possibility is that you are storing them in a non-UNICODE column in your DB: If it's NVARCHAR it's OK, if it's VARCHAR then it won't work correctly. So start by doing "test inserts": use your existing code to insert a "known good" Hebrew phrase string to SQL, and simultaneously convert it to a byte array:
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(myHebrewString);
Then retrieve the same string from the DB (using your existing code) and convert that to a byte array as well. Compare the strings, and compare the byte arrays. If they are the same then the DB and the store / restore code is fine, so you need to start looking at your display code. Sorry, but we can't do any of that for you!
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
I work with mysql VARCHAR utf8_bin and There is no option of NVARCHAR
-
I work with mysql VARCHAR utf8_bin and There is no option of NVARCHAR
Hi, indeed VARCHAR is OK for MySQL; NVARCHAR is an SQL type (e.g. SQLServer) and doesn't exist in MySQL. Did you add
Charset=utf8;
to your connection string? (ref[^]) :)Luc Pattyn [My Articles] Nil Volentibus Arduum
-
Hi, indeed VARCHAR is OK for MySQL; NVARCHAR is an SQL type (e.g. SQLServer) and doesn't exist in MySQL. Did you add
Charset=utf8;
to your connection string? (ref[^]) :)Luc Pattyn [My Articles] Nil Volentibus Arduum
it's work well Thank you for your time and your support :)