GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Text Coding

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
genepi
Familiar Face


Joined: 12 Apr 2008
Posts: 6

PostPosted: Thu May 01, 2008 10:01 pm    Post subject: Text Coding Reply with quote

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
Back to top
Wolfgang
Familiar Face


Joined: 05 Feb 2008
Posts: 37

PostPosted: Sat May 03, 2008 4:46 am    Post subject: Reply with quote

You have to convert passed text to UTF-8 of course. See FAQ or do something like this (in case of Windoze):

Code: (C)
1
2
3
4
5
#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);
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP