[Gtk-sharp-list] Convert Strings

Mario Carrión mario.carrion at gmail.com
Sat Mar 18 00:07:24 EST 2006

On 3/17/06, Jorge Monsalvo <jm_tecno2002 at yahoo.com.ar> wrote:
> Hi,
>         First of all, excuse me if this question is from a newbie, but I can
> finish my application without an answer.
>         I'm working on a Windows application with glade#(gtk#), .NET
> Framework 2.0 and MySQL 5.0. My main language is Spanish (excuse my english)
> and all the data in tables are in spanish.
> The problem I have is to convert string from data in MySQL tables to show in
> TreeView or Text Entrys because the special characters we have in spanish
> (ñ, á, ó, ¿, and others). When I create a query inside the MySQL application
> I can see the strings with the right symbols, but when I make the query from
> my GTK# application I get other characters that have no relation with the
> real ones.
>         I was trying a solution with System.Text.Encoding class methods but
> I have different results (chinese characters, characters that desappear, and
> so).
>         Can somebody point me to the right direction to get a function to
> use?. I remember that in C with plain gtk I used "g_locale_from_utf8"
> function, but I can't find something like that in Gtk#.
> Thanks to you all
Set your database encoding to utf-8, either by reCREATEing all or by
using "SET CHARACTER SET UTF8" as first SQL sentence.

Mario Carrión <mario.carrion at gmail.com>

More information about the Gtk-sharp-list mailing list