Re: g_locale_to_utf8()???




 Oi Murilo - Todo bom ?

gchar*      g_locale_to_utf8                (const gchar *opsysstring,
                                             gssize len,
                                             gsize *bytes_read,
                                             gsize *bytes_written,
                                             GError **error);

http://developer.gnome.org/doc/API/2.0/glib/glib-Character-Set-Conversion.html#g-locale-to-utf8

  -- You have to pass all of the above arguments:

  When passing GError, you need to do something like.

   GError  *error;

   g_locale_to_utf8( <the other args> , &error);

   Note that the function call will allocate the GError for you in case of a
error -- so, you MUST deallocate ( g_error_free(error)) if there was any error.

  Note also that GError is typedef,
  So, you do not have to do:
   struct GError *error .. just GError *error will do.

  ALL (at least the one I have seen) structs on gtk are typedef'ed, so there is
hardly a need to type the word struct when using glib/gtk

Hope this helps.

Harring.


--- Murilo Tuvani <murilo_tuvani yahoo com br> wrote:
how do I use this function, I'm trying to use this

char *texto;
int   lido;
gsize *tamanho;

lido=fread(texto, sizeof(char), aributos->st_size,
arquivo);
texto[lido]='\0';

g_locale_to_utf8(texto, lido, tamanho, NULL);

but it says

callbacks.c:5614: too few arguments to function
`g_locale_to_utf8'

if I use 
struct Gerror **errors;
g_locale_to_utf8(texto, lido, tamanho, errors);

when I compile it says:

callbacks.c:5614: warning: passing arg 4 of
`g_locale_to_utf8' from incompatible pointer type


______________________________________________________________________

Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora:
http://br.yahoo.com/info/mail.html
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools



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