1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-08 18:53:12 +02:00

core: fix display bugs with some UTF-8 chars that truncates messages displayed

Example of char causing problems: U+26C4 (snowman without snow)
This commit is contained in:
Sebastien Helleu
2013-06-29 13:43:27 +02:00
parent 27a427c708
commit f4e4f55de1
2 changed files with 12 additions and 2 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.4.2-dev, 2013-06-28
v0.4.2-dev, 2013-06-29
This document lists all changes for each version.
@@ -14,6 +14,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
Version 0.4.2 (under dev!)
--------------------------
* core: fix display bugs with some UTF-8 chars that truncates messages displayed
(for example U+26C4)
* core: update man page and add translations (in french, german, italian, and
japanese)
* core: remove extra space after empty prefix (when prefix for action, error,
+9 -1
View File
@@ -150,11 +150,19 @@ gui_chat_utf_char_valid (const char *utf_char)
int
gui_chat_char_size_screen (const char *utf_char)
{
int size_screen;
/* if char is invalid, it will be displayed as one space on screen */
if (!gui_chat_utf_char_valid (utf_char))
return 1;
return utf8_char_size_screen (utf_char);
size_screen = utf8_char_size_screen (utf_char);
/*
* ensure the size is always >= 1, to prevent any display bug
* (for example UTF-8 char U+26C4 returns size < 1)
*/
return (size_screen >= 1) ? size_screen : 1;
}
/*