diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-08-22 08:53:33 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-08-22 08:53:33 +0200 |
commit | 2c4b0e32ec654903f6c0b934a556012fc2f0f696 (patch) | |
tree | 26df35705e184ec3a9c2670a980e5213745edf1d /src/plugins/irc | |
parent | 0513800cb6eac66360320c4fba63354482f293b7 (diff) | |
download | weechat-2c4b0e32ec654903f6c0b934a556012fc2f0f696.zip |
irc: fix display of invalid UTF-8 chars in raw buffer
Invalid UTF-8 chars are now displayed as hexadecimal codes, for example:
"test\xE9" instead of "test?" (the real word being "testé").
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-raw.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-raw.c b/src/plugins/irc/irc-raw.c index 598e2abee..6c4955669 100644 --- a/src/plugins/irc/irc-raw.c +++ b/src/plugins/irc/irc-raw.c @@ -238,7 +238,9 @@ irc_raw_message_add (struct t_irc_server *server, int flags, pos_buf2 = 0; while (ptr_buf[pos_buf]) { - if (ptr_buf[pos_buf] < 32) + if ((ptr_buf[pos_buf] < 32) + || !weechat_utf8_is_valid ((const char *)(ptr_buf + pos_buf), + 1, NULL)) { buf2[pos_buf2++] = '\\'; buf2[pos_buf2++] = 'x'; |