[Gambas-user] Problem with UTF-8 in Gambas-connection to MySQL

Benoît Minisini gambas at ...1...
Sun Sep 13 02:13:21 CEST 2009


> (I don't know English well)
> Use Debian 5 "Lenny" -32, Gambas 2.7 from repository.
> 
> I develop an account program for russians users. It must work with cyrillic
> correct.
> I have made MySQL5 (default UTF8) database with direct CHARACTER SET UTF8
> option, tables with direct CHARACTER SET UTF8 option. Then connected to it
> from gambas, output data to GridView. All string fields were not readable.
> 
> I run example "Database". It works correct with some french symbols, but
> with cyrillic not. Program "Database manager" do the same.
> 
> I get sources of Gambas-2.8.2. Opened main.c file of MySQL driver, find
> function
>   <<< static int open_database(DB_DESC *desc, DB_DATABASE *db) >>>.
> Add string
>   <<< fprintf(stderr, "Character set GB[%s] mysql[%s]\n",
> GB.System.Charset(), mysql_character_set_name(conn)); >>>
> before and after string
>   <<< set_character_set(db); >>>.
> Compiled only this driver, copied it to /usr/lib/gambas2. Run my program.
> Result:
>   <<< Character set GB[UTF-8] mysql[latin1]
>          Character set GB[UTF-8] mysql[latin1] >>>
> in console.
> 
> Why latin1 instead UTF-8?

What is the value of DB.Charset just after you have connected to the database 
in Gambas?

What happens if you uncheck the "use encoding" menu entry if the popup menu in 
the database manager?

Can you send me your database contents, or part of it, so that I test by 
myself?

-- 
Benoît Minisini




More information about the User mailing list