diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-05-13 09:22:34 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-05-14 07:59:46 +0000 |
commit | bda417a54fbd5e49403620542fbb5cba2d9b3aad (patch) | |
tree | 15425a406f747da9363f6fadae13f21efdf77f76 /epan/print_stream.c | |
parent | 8c95f9659955536a5821087476b61922334ddd8d (diff) |
Use g_get_charset instead of g_get_codeset.
From Guy via
https://www.wireshark.org/lists/wireshark-dev/201605/msg00027.html
Change-Id: I7884cecb6cd87f474ecc3f84253797fe57f62487
Reviewed-on: https://code.wireshark.org/review/15421
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/print_stream.c')
-rw-r--r-- | epan/print_stream.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/epan/print_stream.c b/epan/print_stream.c index 740773af2e..162bedaef3 100644 --- a/epan/print_stream.c +++ b/epan/print_stream.c @@ -28,8 +28,6 @@ #ifdef _WIN32 #include <windows.h> -#else -#include <string.h> #endif #include <glib.h> @@ -146,14 +144,14 @@ print_line_text(print_stream_t *self, int indent, const char *line) #ifndef _WIN32 /* Is there a more reliable way to do this? */ if (!tty_codeset) { - gchar *upper_codeset; + const gchar *charset; + gboolean is_utf8; - tty_codeset = g_get_codeset(); - upper_codeset = g_ascii_strup(tty_codeset, -1); - if (!strstr(upper_codeset, "UTF-8") && !strstr(upper_codeset, "UTF8")) { + is_utf8 = g_get_charset(&charset); + tty_codeset = g_strdup(charset); + if (!is_utf8) { to_codeset = tty_codeset; } - g_free(upper_codeset); } #endif |