Change isprint() calls in follow_stream.c (shared code that supports Follow
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 6 Dec 2010 18:34:26 +0000 (18:34 +0000)
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 6 Dec 2010 18:34:26 +0000 (18:34 +0000)
TCP, UDP and SSL streams) to g_unichar_isprint() so that UTF-8 characters
are displayed properly.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35132 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/follow_stream.c

index 21cf1a6364059e1e640e1a3dc26c9dfa05ac5177..2aa75e3ff325a418daebaa13faa097e67fdd5b0b 100644 (file)
@@ -42,7 +42,6 @@
 #include <epan/charsets.h>
 
 #include <../alert_box.h>
-#include <../isprint.h>
 #include <../print.h>
 #include <../simple_dialog.h>
 #include <wsutil/file_util.h>
@@ -117,7 +116,7 @@ follow_add_to_gtk_text(char *buffer, size_t nchars, gboolean is_server,
        for (i = 0; i < nchars; i++) {
                if (buffer[i] == '\n' || buffer[i] == '\r')
                        continue;
-               if (! isprint((guchar)buffer[i])) {
+               if (! g_unichar_isprint((guchar)buffer[i])) {
                        buffer[i] = '.';
                }
        }
@@ -152,7 +151,7 @@ follow_print_text(char *buffer, size_t nchars, gboolean is_server _U_,
        for (i = 0; i < nchars; i++) {
                if (buffer[i] == '\n' || buffer[i] == '\r')
                        continue;
-               if (! isprint((guchar)buffer[i])) {
+               if (! g_unichar_isprint((guchar)buffer[i])) {
                        buffer[i] = '.';
                }
        }
@@ -1043,7 +1042,7 @@ follow_show(follow_info_t *follow_info,
                        /* Now dump bytes as text */
                        for (i = 0; i < 16 && current_pos + i < nchars; i++) {
                                *cur++ =
-                                       (isprint((guchar)buffer[current_pos + i]) ?
+                                       (g_unichar_isprint((guchar)buffer[current_pos + i]) ?
                                         buffer[current_pos + i] : '.' );
                                if (i == 7) {
                                        *cur++ = ' ';