From 61f3f64c69320e47adf8a67e9069e546fe0c5f7a Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sun, 4 Aug 2013 23:36:58 -0400 Subject: [PATCH] iconv: Ignore unrepresentable characters when transliterating MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Certain characters where causing iconv() to fail, which resulted in buggy rendering. By adding "//IGNORE" to the already existing "//TRANSLIT" flag unrepresentable characters are automatically removed from the resulting output. > echo "Nguyễn Thái Ngọc Duy" | iconv -f UTF-8 -t ASCII//TRANSLIT Nguy iconv: (stdin):1:4: cannot convert > echo "Nguyễn Thái Ngọc Duy" | iconv -f UTF-8 -t ASCII//TRANSLIT//IGNORE Nguyn Th'ai Ngc Duy --- NEWS | 1 + tig.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 0394407..c11da01 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,7 @@ Bug fixes: - Fix rendering glitch for branch names. - Do not apply diff styling to untracked files in the stage view. (GH #153) - Fix tree indentation for entries containing combining characters. (GH #170) + - Ignore unrepresentable characters when transliterating text for rendering. tig-1.1 ------- diff --git a/tig.h b/tig.h index 924af14..743b1d2 100644 --- a/tig.h +++ b/tig.h @@ -108,7 +108,7 @@ #ifndef ICONV_CONST #define ICONV_CONST /* nothing */ #endif -#define ICONV_TRANSLIT "//TRANSLIT" +#define ICONV_TRANSLIT "//TRANSLIT//IGNORE" /* The format and size of the date column in the main view. */ #define DATE_FORMAT "%Y-%m-%d %H:%M" -- 2.11.4.GIT