After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 57695 - How should O_BINARY be handled for GIOChannel under the new API?
How should O_BINARY be handled for GIOChannel under the new API?
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
1.3.x
Other Windows
: Normal normal
: ---
Assigned To: Tor Lillqvist
Tor Lillqvist
Depends on:
Blocks:
 
 
Reported: 2001-07-17 22:09 UTC by Ron Steinke
Modified: 2011-02-18 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ron Steinke 2001-07-17 22:09:09 UTC
see summary
Comment 1 Owen Taylor 2001-08-04 14:25:56 UTC
From
http://mail.gnome.org/archives/gtk-devel-list/2001-August/msg00080.html:

My comment was:

Let's:

 * Always specify O_BINARY on platforms where it matters

 * Keep in mind the future possibility of something like:
   g_io_channel_set_newline_format (channel, "\r\n");

   This becomes most useful when we add encoding autodetection
   to glib - planned for a future version. Then we 
   can add newline detection like that, and get the effect
   of something similar to Emacs's newline handling. Emacs,
   when it reads a file, autodetects the newline format
   as part of encoding detection, so you get an encoding
   like EUC-JP-DOS, manipulates newlines internally as
   '\n' then uses the same newline format when writing
   out the file.
  
I think it is a good trait if the DOS and Unix versions of a
program by default produce identical output files. 

And not specifying O_BINARY corrupts encodings such UTF-16.

If we add the functionality to do read/write conversions
of newlines, it should happen on the UTF-8 side of the 
conversion, and should be cross-platform.

Comment 2 Owen Taylor 2001-08-21 20:27:09 UTC
I believe this was decided upon, and we'll consider the
fact that Win32 doesn't specify O_BINARY here simply
an implementation bug.
Comment 3 Hans Breuer 2001-09-22 17:50:47 UTC
since

2001-09-21  Hans Breuer  <hans@breuer.org>

	* glib/giowin32.c (g_io_channel_new_file) : always open
	in binary mode

resolved.
Comment 4 Tor Lillqvist 2001-11-06 00:44:24 UTC
Fixed by Hans Breuer on 2001-09-21.