Re: Writing a buffer with UTF-8 content.



The more I try the less I understand.

When I convert the buffer explicitly from utf-8 to utf-8 the results
stay the same.

When I log the buffer to stdout, all the encoding stays well and all
the locales are seen in their own fonts (I got most fonts of the world
installed), when written to file all faults up.

AAAAAAAAAAAAAARRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGGG!!!!!!!!!!!!!!!!!!



-- 
(o_
//\  Regards, Groeten,
V_/_ Bas Burger.


On Thu, 26 Jul 2012 22:13:33 +0200
Yaa101 <yaa101 xs4all nl> wrote:

> I was wrong, any filesave method just saves into whatever encoding,
> opening the resultant file in gedit gives an ecoding error and none
> whatsoever encoding import helps.
> 
> When I edit the original with gedit I can open it (it is UTF-8)
> and saving it will preserve all the locale strings in any language.
> 
> 
> 
> What I do is loading a file and put it in the keyfile object with:
> 
> keyFile.load_from_file(this._path, (GLib.KeyFileFlags.KEEP_COMMENTS
> | GLib.KeyFileFlags.KEEP_TRANSLATIONS));
> 
> I can manipulate the resulting buffer with all the keyfile methods.
> When I log the buffer to stdout, everything is preserved, but when I
> write that same buffer to file it gets all garbled.
> 
> 
> I really don't understand.
> I also don't understand why there is no keyFile.to_file(); method.
> 
> 



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