Re: Fw: view cant' show special characters (at least not with gtk_text_buffer_set_text() so far)



Hi,

"calmar" <mac calmar ws> writes:

> >the text put into a GtkTextView (or any other GTK+-2.0 widget)
> >absolutely needs to be UTF-8 encoded. Glib provides a number of
> >functions that help you to convert from and to other encodings.
> 
> i tried something like this:
> //code begin
> 
> char  ** end;
> 
> if ( ! (g_utf8_validate  (  pointer_string_to_validate, -1 , (const char **)
> end) ) )
> {
>  **end=  (const char) "." ;
> }

this should work (untested):

gchar *end;

if (! g_utf8_validate (pointer_string_to_validate, -1 , &end))
  {
    *end = '.';
  }


Salut, Sven



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]