Re: Reading UTF-8 encoded text file



On Wed, Sep 08, 2004 at 02:44:17PM +0200, Magyari, Miklos wrote:
hi all,
 
I have a file that is an UTF-8 encoded text file. I would like to read
it line by line and place the lines in GString.
My idea was using standard library calls (such us fgets) for file
manipulation and reading the lines to a char* buffer, and then some glib
API calls to place these strings into a GString (e.g I've tried
g_string_new). Unfortunately there is something wrong as I'm unable to
have the correct UTF-8 strings in the GStrings, it seems that the data
is converted somewhere.
 
I would really appreciate any suggestions about which API calls should I
use.

Depending where you're reading the text from you may want to have a
look at libgsf.  It has some text import facilities and is used by
most of the text based formats in gnumeric.



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