GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Mon Sep 22, 2014 10:12 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Text Coding
PostPosted: Thu May 01, 2008 10:01 pm 
Offline
Familiar Face

Joined: Sat Apr 12, 2008 7:36 pm
Posts: 6
I have problem with Text Coding . I need to change labels - using label_set_text. Problem is, that I need to use Czech language - when I use some special symbol from this language I get warning "Invalid UTF-8 string passed to pango_layout_set_text()". What can I do about it?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 03, 2008 4:46 am 
Offline
GTK+ Guru

Joined: Tue Feb 05, 2008 8:39 am
Posts: 130
You have to convert passed text to UTF-8 of course. See FAQ or do something like this (in case of Windoze):

Code:
#define UTF8_TEXT(X)     g__convert(X, -1, "UTF-8", "windows-1251")

gchar *t = UTF8_TEXT("some czech text");
gtk_label_set_text(label, t);
g_free(t);


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group