summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.asciidoc2
-rw-r--r--src/plugins/irc/irc-raw.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc
index 8f54b9def..f962d5159 100644
--- a/ChangeLog.asciidoc
+++ b/ChangeLog.asciidoc
@@ -23,6 +23,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
=== Bugs fixed
+* irc: fix display of invalid UTF-8 chars in raw buffer
+
== Version 1.3 (2015-08-16)
=== New features
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';