From eaf8e13856cc9a8379af762c2ac1279db5157784 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 21 Nov 2002 20:54:44 +0000 Subject: [PATCH] Add helpful comments about the encoding of a new iochannel. (Amaury Thu Nov 21 15:52:04 2002 Owen Taylor * glib/tmpl/iochannels.sgml: Add helpful comments about the encoding of a new iochannel. (Amaury Jacquot, #96444) --- docs/reference/ChangeLog | 6 ++++++ docs/reference/glib/tmpl/iochannels.sgml | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index e15adcd2..4eaa9868 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,9 @@ +Thu Nov 21 15:52:04 2002 Owen Taylor + + * glib/tmpl/iochannels.sgml: Add helpful comments about + the encoding of a new iochannel. (Amaury Jacquot, + #96444) + 2002-11-21 Matthias Clasen * glib/tmpl/string_utils.sgml: Add note on including gprintf.h, diff --git a/docs/reference/glib/tmpl/iochannels.sgml b/docs/reference/glib/tmpl/iochannels.sgml index acae9f67..380e7b38 100644 --- a/docs/reference/glib/tmpl/iochannels.sgml +++ b/docs/reference/glib/tmpl/iochannels.sgml @@ -86,6 +86,17 @@ On UNIX systems this works for plain files, pipes, and sockets. The returned #GIOChannel has a reference count of 1. + +The default encoding for #GIOChannel is UTF-8. If your application +is reading output from a command using via pipe, you may need to +set the encoding to the encoding of the current locale (see +g_get_charset()) with the g_io_channel_set_encoding() function. + + +If you want to read raw binary data without interpretation, then +call the g_io_charset_set_encoding() function with %NULL for the +encoding argument. + @fd: a file descriptor. @Returns: a new #GIOChannel. -- 2.34.1