Re: Converting from ASCII to UTF-8



Please beware that you can get by without converting if you are really
using the ASCII characters 32-127, since then UTF8 is the same as
ASCII. But for other characters, e.g. iso8859-1 above 128, you have to
use the converter routine before putting the text in the textviewer.

Regards,
Dov

On 3/29/06, Meli Vázquez <ribonucleico gmail com> wrote:
> Sorry.
>
> Now it works.  It seems I didn't need to convert the string.
>
> On 3/29/06, Meli Vázquez <ribonucleico gmail com> wrote:
> > Hi guys,
> >
> > I'm writing some text in a GtkTextBuffer. Text strings are ASCII encoded.
> > I've tried converting my string with g_convert() but I still don't see
> > any text written in the GtkTextView widget.
> >
> > This is more or less what I have:
> > ----------
> > char string[20] = "Hello world";
> >
> > textBuffer      = gtk_text_view_get_buffer (...);
> > convertedString = g_convert(... "UTF-8", "ASCII"...);
> > gtk_text_buffer_set_text(...)
> > -------
> >
> > How can I convert an ASCII string to a UTF-8 string? What am I doing wrong?
> >
> > --
> > Amelio V.
> >
>
>
> --
> Amelio V.
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>



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