Bug #6722 | Not able to insert data using greek symbols | ||
---|---|---|---|
Submitted: | 19 Nov 2004 16:38 | Modified: | 6 Jan 2005 21:44 |
Reporter: | Nicholas Large | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / ODBC | Severity: | S1 (Critical) |
Version: | 5.0.0-alpha-max-debug | OS: | Windows (Windows XP) |
Assigned to: | CPU Architecture: | Any |
[19 Nov 2004 16:38]
Nicholas Large
[6 Jan 2005 21:42]
Hartmut Holzgraefe
looks like your installation is missing the greek latin7 character set as it doesn't show up in "SHOW CHARACTER SET" but anyway, if you want to mix regular latin1 european characters with greek latin7 your only option is to configure your MySQL server to use UTF-8 as its default character set all over the place right now you are using latin1 for anything but the system tables so non-latin1 characters have to be replaced by something else, question marks in this case see http://dev.mysql.com/doc/mysql/en/Charset.html for details on character set support in MySQL
[6 Jan 2005 21:44]
Hartmut Holzgraefe
PS: the bug system to ask this kind of questions, please use our mailing lists or public web forums for this in the future see http://lists.mysql.com/ and http://forums.mysql.com/
[11 Apr 2005 13:29]
Mircea Pop
Hi Nicholas, I have the same problem and I don't know how to fix it. Can you help me? I am using Mysql 4.0.24. Thanks, Mircea
[11 Apr 2005 15:23]
Nicholas Large
Hello Mircea A lot has changed since I wrote this email originally. If your still having problems, you can contact me on nlarge@nobodyleargas.ie, just take the nobody out. Cheers, Nick.
[12 Apr 2005 6:34]
Mircea Pop
Hi, I've developed an application that stores some data in a mysql database. The application is written in VB .NET. I have only a table with a few fields, one of which is a TEXT field. In this field I want to store text in greek and also normal text. Then I publish the table using php ( a simple html generated page). How do I have to setup mysql so that the greek characters are insered correctly, and how do I sent them from vb.NET. Also the email address nlarge@nobodyleargas.ien is not good. Thanks, Mircea
[12 Apr 2005 9:02]
Nicholas Large
Hi Mircea. If you do not include the word "nobody" in the email address nlarge@nobodyleargas.ie you will get the correct email address. I only write the incorrect email to ensure that no spammers can get at it. Also, You have to ensure that the database is in utf-8 format. This is done by using the "show full columns from" command. Eg. Show full columns from mytable This will produce a more detailed list than "describe mytable" does. In this list is a column called "collation". This needs to be utf8_unicode_ci. How do we do this? Well, you need to execute the following commands, but it will be worth backing up your database first if this database has plenty of data in it, as some inconsistencies may arise (you just don't know!?): use databasename show variables like 'c%' look at the list of variables (its worth flicking through the manual to get a read on what they mean. set character_set_database = utf8; set character_set_server = utf8; set character_set_system = utf8; set collation_database = utf8_general_ci; set collation_server = utf8_general_ci; set names utf8; Now all your collations and character sets should be set correctly. Try this and try an insert. Another note is that the "set names" command only lasts for as long as the connection is open, not for as long as the server is up, and is specific only to a particular connection. Upon initializing a connection to a database it is worth sending the "set names utf8" command to ensure that items are returned correctly. If you use Visual Studio .NET as a development tool you will have to use the --ansi-quotes option in order to use Visual studio .net server explorer with mysql when dragging items from server explorer to a dataset. Hope this helps. NL.