Re: Glib::IO
- From: "max augsburg gmx de" <max augsburg gmx de>
- To: Jeremy Volkening <jdv base2bio com>
- Cc: gtk-perl-list gnome org
- Subject: Re: Glib::IO
- Date: Wed, 01 Jun 2016 23:57:00 +0200
Dear Jeremy,
I don't think you can make any assumptions about the encoding of the
underlying file, or even that is is text rather than a binary format.
I agree with you that the byte array should be converted into a byte
string but beyond that the user needs to decide what to do with it
based on the file type expected by their application.
I think, you are absolutely right! I just wondered, why in Python you
don't have to convert the byte digits in a byte string or to decode the
bytestring in UTF-8 format (see for example:
https://developer.gnome.org/gnome-devel-demos/stable/filechooserdialog.py.html.en)
But probably they have modified the Gtk3::TextBuffer->set_buffer()
method (I think the Gtk3::TextBuffer works always in UTF-8).
So I would let the Encode::decode stuff in the overrides out, and just
convert the bytes to a byte string with the pack() or the unpack()
functions...
I went ahead and forked the Glib::IO codebase here:
https://github.com/jvolkening/perl-Glib-IO
I realize we can't send pull requests to the "official" github repo
since it's only a mirrored copy of the GNOME repo, but the fork provides
a place to collaborate prior to sending the patches upstream. If you'd
like I can give you commit permissions. My work on
it will probably be sporadic.
Collaborating on github is a very good idea, although I am still not
very familiar with github. On the other hand for me it is a great
enrichment to discuss my succested proposals here with more experienced
programmers. But perhaps this could be annoying for people that are not
interested in the Glib::IO module ;-)
My github account is https://github.com/MaxPerl
All the best,
Max
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]