diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-03-08 15:50:54 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-03-08 15:50:54 +0000 |
commit | cef5d28c897af6b057d04420ebd040e70e5a693e (patch) | |
tree | 8f8cd049bb2b4923c82bb04941da7b832248e6d9 | |
parent | dac25522cd299436ac1a7fe366e66d9a348e1715 (diff) |
Final updates for 2.0.0
Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com>
* NEWS: Final updates for 2.0.0
* glib/gstrfuncs.c: Convert the results of strerror()
and strsignal() to UTF-8.
* glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c
glib/giowin32.c: Use g_strerror(), not strerror().
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-12 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 10 | ||||
-rw-r--r-- | NEWS | 20 | ||||
-rw-r--r-- | README.in | 4 | ||||
-rw-r--r-- | glib/gconvert.c | 6 | ||||
-rw-r--r-- | glib/gdir.c | 4 | ||||
-rw-r--r-- | glib/gfileutils.c | 14 | ||||
-rw-r--r-- | glib/giochannel.c | 6 | ||||
-rw-r--r-- | glib/giounix.c | 14 | ||||
-rw-r--r-- | glib/giowin32.c | 12 | ||||
-rw-r--r-- | glib/gstrfuncs.c | 38 |
17 files changed, 164 insertions, 34 deletions
@@ -1,3 +1,13 @@ +Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com> + + * NEWS: Final updates for 2.0.0 + + * glib/gstrfuncs.c: Convert the results of strerror() + and strsignal() to UTF-8. + + * glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c + glib/giowin32.c: Use g_strerror(), not strerror(). + Fri Mar 8 00:15:29 2002 Owen Taylor <otaylor@redhat.com> * README.in: Updates. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 109fb6313..33fe570ad 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com> + + * NEWS: Final updates for 2.0.0 + + * glib/gstrfuncs.c: Convert the results of strerror() + and strsignal() to UTF-8. + + * glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c + glib/giowin32.c: Use g_strerror(), not strerror(). + Fri Mar 8 00:15:29 2002 Owen Taylor <otaylor@redhat.com> * README.in: Updates. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 109fb6313..33fe570ad 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com> + + * NEWS: Final updates for 2.0.0 + + * glib/gstrfuncs.c: Convert the results of strerror() + and strsignal() to UTF-8. + + * glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c + glib/giowin32.c: Use g_strerror(), not strerror(). + Fri Mar 8 00:15:29 2002 Owen Taylor <otaylor@redhat.com> * README.in: Updates. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 109fb6313..33fe570ad 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,13 @@ +Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com> + + * NEWS: Final updates for 2.0.0 + + * glib/gstrfuncs.c: Convert the results of strerror() + and strsignal() to UTF-8. + + * glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c + glib/giowin32.c: Use g_strerror(), not strerror(). + Fri Mar 8 00:15:29 2002 Owen Taylor <otaylor@redhat.com> * README.in: Updates. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 109fb6313..33fe570ad 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com> + + * NEWS: Final updates for 2.0.0 + + * glib/gstrfuncs.c: Convert the results of strerror() + and strsignal() to UTF-8. + + * glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c + glib/giowin32.c: Use g_strerror(), not strerror(). + Fri Mar 8 00:15:29 2002 Owen Taylor <otaylor@redhat.com> * README.in: Updates. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 109fb6313..33fe570ad 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com> + + * NEWS: Final updates for 2.0.0 + + * glib/gstrfuncs.c: Convert the results of strerror() + and strsignal() to UTF-8. + + * glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c + glib/giowin32.c: Use g_strerror(), not strerror(). + Fri Mar 8 00:15:29 2002 Owen Taylor <otaylor@redhat.com> * README.in: Updates. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 109fb6313..33fe570ad 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com> + + * NEWS: Final updates for 2.0.0 + + * glib/gstrfuncs.c: Convert the results of strerror() + and strsignal() to UTF-8. + + * glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c + glib/giowin32.c: Use g_strerror(), not strerror(). + Fri Mar 8 00:15:29 2002 Owen Taylor <otaylor@redhat.com> * README.in: Updates. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 109fb6313..33fe570ad 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +Fri Mar 8 10:20:46 2002 Owen Taylor <otaylor@redhat.com> + + * NEWS: Final updates for 2.0.0 + + * glib/gstrfuncs.c: Convert the results of strerror() + and strsignal() to UTF-8. + + * glib/gconvert.c glib/gdir.c glib/giochannel.c glib/giounix.c + glib/giowin32.c: Use g_strerror(), not strerror(). + Fri Mar 8 00:15:29 2002 Owen Taylor <otaylor@redhat.com> * README.in: Updates. @@ -1,3 +1,23 @@ +Overview of Changes in GLib 2.0.0 +================================= + +* Thread portability fixes [Sebastian Wilhelmi] +* Documentation updates [Owen Taylor] +* Make g_strerror(), g_strsignal() properly return UTF-8, + call bind_text_domain_codeset() so that error strings + are in UTF-8 as well. [Owen, Tor Lillqvist] + +Overview of Changes in GLib 2.0.0 rc1: +====================================== + +* Win32 fixes [Tor Lillqvist] +* Portability fixes [Finlay Dobbie, Miroslaw Dobrzanski-Neumann] +* Fix up g_date_strftime [Daniel Elstner] +* Add some structure padding [Tim Janik] +* Make g_get_homedir() prefer the users home directory to $HOME + +Other contributors: Matthias Clasen, Paolo Maggi, Christian Rose + Overview of Changes in GLib 1.3.15: =================================== @@ -34,10 +34,6 @@ Notes about GLib-2.0.0 Application programmers should not call g_locale_to_utf8() on these strings. -* The results of g_strerror() are currently in the encoding of the locale - rather than in UTF-8. Again, this is a bug, and not behavior that - should be relied upon. - * Similarly, the GLib error logging functions such as g_print(), g_warning(), g_error(), currently do not convert the strings they are passed from UTF-8 to the encoding of the locale, or check that the strings they diff --git a/glib/gconvert.c b/glib/gconvert.c index 79cad6ba3..9ecb8bed0 100644 --- a/glib/gconvert.c +++ b/glib/gconvert.c @@ -392,7 +392,7 @@ open_converter (const gchar *to_codeset, else g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, _("Could not open converter from '%s' to '%s': %s"), - from_codeset, to_codeset, strerror (errno)); + from_codeset, to_codeset, g_strerror (errno)); return cd; } @@ -595,7 +595,7 @@ g_convert_with_iconv (const gchar *str, default: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, _("Error during conversion: %s"), - strerror (errno)); + g_strerror (errno)); have_error = TRUE; break; } @@ -811,7 +811,7 @@ g_convert_with_fallback (const gchar *str, default: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, _("Error during conversion: %s"), - strerror (errno)); + g_strerror (errno)); have_error = TRUE; break; } diff --git a/glib/gdir.c b/glib/gdir.c index aaf967add..dafd34372 100644 --- a/glib/gdir.c +++ b/glib/gdir.c @@ -24,7 +24,7 @@ #include "config.h" #include <errno.h> -#include <string.h> /* strerror, strcmp */ +#include <string.h> /* strcmp */ #ifdef HAVE_DIRENT_H #include <dirent.h> @@ -77,7 +77,7 @@ g_dir_open (const gchar *path, G_FILE_ERROR, g_file_error_from_errno (errno), _("Error opening directory '%s': %s"), - path, strerror (errno)); + path, g_strerror (errno)); g_free (dir); return NULL; diff --git a/glib/gfileutils.c b/glib/gfileutils.c index 37b06f508..fbe8bd728 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -346,7 +346,7 @@ get_contents_stdio (const gchar *filename, G_FILE_ERROR, g_file_error_from_errno (errno), _("Error reading file '%s': %s"), - filename, strerror (errno)); + filename, g_strerror (errno)); goto error; } @@ -424,7 +424,7 @@ get_contents_regfile (const gchar *filename, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to read from file '%s': %s"), - filename, strerror (errno)); + filename, g_strerror (errno)); return FALSE; } @@ -463,7 +463,7 @@ get_contents_posix (const gchar *filename, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to open file '%s': %s"), - filename, strerror (errno)); + filename, g_strerror (errno)); return FALSE; } @@ -477,7 +477,7 @@ get_contents_posix (const gchar *filename, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to get attributes of file '%s': fstat() failed: %s"), - filename, strerror (errno)); + filename, g_strerror (errno)); return FALSE; } @@ -503,7 +503,7 @@ get_contents_posix (const gchar *filename, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to open file '%s': fdopen() failed: %s"), - filename, strerror (errno)); + filename, g_strerror (errno)); return FALSE; } @@ -531,7 +531,7 @@ get_contents_win32 (const gchar *filename, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to open file '%s': %s"), - filename, strerror (errno)); + filename, g_strerror (errno)); return FALSE; } @@ -743,7 +743,7 @@ g_file_open_tmp (const char *tmpl, G_FILE_ERROR, g_file_error_from_errno (errno), _("Failed to create file '%s': %s"), - fulltemplate, strerror (errno)); + fulltemplate, g_strerror (errno)); g_free (fulltemplate); return -1; } diff --git a/glib/giochannel.c b/glib/giochannel.c index a82bf0e47..7a7e980a1 100644 --- a/glib/giochannel.c +++ b/glib/giochannel.c @@ -1112,7 +1112,7 @@ g_io_channel_set_encoding (GIOChannel *channel, else g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, _("Could not open converter from `%s' to `%s': %s"), - from_enc, to_enc, strerror (err)); + from_enc, to_enc, g_strerror (err)); if (read_cd != (GIConv) -1) g_iconv_close (read_cd); @@ -1286,7 +1286,7 @@ reencode: default: g_assert (errval != EBADF); /* The converter should be open */ g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - _("Error during conversion: %s"), strerror (errval)); + _("Error during conversion: %s"), g_strerror (errval)); return G_IO_STATUS_ERROR; } } @@ -2172,7 +2172,7 @@ reconvert: return G_IO_STATUS_ERROR; default: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - _("Error during conversion: %s"), strerror (errnum)); + _("Error during conversion: %s"), g_strerror (errnum)); if (from_buf_len >= left_len + from_buf_old_len) wrote_bytes += from_buf_len - left_len - from_buf_old_len; if (bytes_written) diff --git a/glib/giounix.c b/glib/giounix.c index 84b2623eb..d347de5b2 100644 --- a/glib/giounix.c +++ b/glib/giounix.c @@ -201,7 +201,7 @@ g_io_unix_read (GIOChannel *channel, default: g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return G_IO_STATUS_ERROR; } } @@ -241,7 +241,7 @@ g_io_unix_write (GIOChannel *channel, default: g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return G_IO_STATUS_ERROR; } } @@ -283,7 +283,7 @@ g_io_unix_seek (GIOChannel *channel, { g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (EINVAL), - strerror (EINVAL)); + g_strerror (EINVAL)); return G_IO_STATUS_ERROR; } @@ -293,7 +293,7 @@ g_io_unix_seek (GIOChannel *channel, { g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return G_IO_STATUS_ERROR; } @@ -311,7 +311,7 @@ g_io_unix_close (GIOChannel *channel, { g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return G_IO_STATUS_ERROR; } @@ -510,7 +510,7 @@ g_io_channel_new_file (const gchar *filename, { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return (GIOChannel *)NULL; } @@ -519,7 +519,7 @@ g_io_channel_new_file (const gchar *filename, close (fid); g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return (GIOChannel *)NULL; } diff --git a/glib/giowin32.c b/glib/giowin32.c index fae780c99..9f20a08cf 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -334,7 +334,7 @@ create_thread (GIOWin32Channel *channel, &channel->thread_id); if (channel->thread_handle == 0) g_warning (G_STRLOC ": Error creating reader thread: %s", - strerror (errno)); + g_strerror (errno)); WaitForSingleObject (channel->space_avail_event, INFINITE); } @@ -852,7 +852,7 @@ g_io_win32_fd_read (GIOChannel *channel, default: g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return G_IO_STATUS_ERROR; } } @@ -890,7 +890,7 @@ g_io_win32_fd_write (GIOChannel *channel, default: g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return G_IO_STATUS_ERROR; } } @@ -932,7 +932,7 @@ g_io_win32_fd_seek (GIOChannel *channel, { g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (EINVAL), - strerror (EINVAL)); + g_strerror (EINVAL)); return G_IO_STATUS_ERROR; } @@ -942,7 +942,7 @@ g_io_win32_fd_seek (GIOChannel *channel, { g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return G_IO_STATUS_ERROR; } @@ -1236,7 +1236,7 @@ g_io_channel_new_file (const gchar *filename, { g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), - strerror (errno)); + g_strerror (errno)); return (GIOChannel *)NULL; } diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index 6469618aa..28ccc9e3b 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -586,7 +586,24 @@ g_strerror (gint errnum) char *msg; #ifdef HAVE_STRERROR - return strerror (errnum); + const char *msg_locale; + + msg_locale = strerror (errnum); + if (g_get_charset (NULL)) + return msg_locale; + else + { + gchar *msg_utf8 = g_locale_to_utf8 (msg_locale, -1, NULL, NULL, NULL); + if (msg_utf8) + { + /* Stick in the quark table so that we can return a static result + */ + GQuark msg_quark = g_quark_from_string (msg_utf8); + g_free (msg_utf8); + + return g_quark_to_string (msg_quark); + } + } #elif NO_SYS_ERRLIST switch (errnum) { @@ -1029,13 +1046,30 @@ g_strsignal (gint signum) char *msg; #ifdef HAVE_STRSIGNAL + const char *msg_locale; + #if defined(G_OS_BEOS) || defined(G_WITH_CYGWIN) extern const char *strsignal(int); #else /* this is declared differently (const) in string.h on BeOS */ extern char *strsignal (int sig); #endif /* !G_OS_BEOS && !G_WITH_CYGWIN */ - return strsignal (signum); + msg_locale = strsignal (signum); + if (g_get_charset (NULL)) + return msg_locale; + else + { + gchar *msg_utf8 = g_locale_to_utf8 (msg_locale, -1, NULL, NULL, NULL); + if (msg_utf8) + { + /* Stick in the quark table so that we can return a static result + */ + GQuark msg_quark = g_quark_from_string (msg_utf8); + g_free (msg_utf8); + + return g_quark_to_string (msg_quark); + } + } #elif NO_SYS_SIGLIST switch (signum) { |