diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2020-08-30 00:57:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 00:57:05 +0000 |
commit | 8c164d80ad769b28fcd0d6c17722507a4e63c8ab (patch) | |
tree | ba10b68db484a2ece59738e9e341d623ee010062 /entity.c | |
parent | Update ChangeLog (diff) | |
parent | Somehow the wrong quotes were used. This should fix the failing tests. (diff) | |
download | w3m-8c164d80ad769b28fcd0d6c17722507a4e63c8ab.tar.gz w3m-8c164d80ad769b28fcd0d6c17722507a4e63c8ab.zip |
Merge pull request #139 from acli/20200823_q_CLEANED
Cleaned version of 20200823_q branch. Changes the behaviour of the q …
Diffstat (limited to 'entity.c')
-rw-r--r-- | entity.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -58,11 +58,23 @@ conv_entity(unsigned int c) #ifdef USE_M17N #ifdef USE_UNICODE if (c <= WC_C_UCS4_END) { /* Unicode */ + char *chk; wc_uchar utf8[7]; wc_ucs_to_utf8(c, utf8); - return wc_conv((char *)utf8, WC_CES_UTF_8, InnerCharset)->ptr; + /* we eventually need to display it so check DisplayCharset */ + chk = wc_conv((char *)utf8, WC_CES_UTF_8, DisplayCharset ? DisplayCharset : WC_CES_US_ASCII)->ptr; + if (strcmp(chk, "?") != 0) + return wc_conv((char *)utf8, WC_CES_UTF_8, InnerCharset)->ptr; } #endif #endif + if (c == 0x201c || c == 0x201f || c == 0x201d || c == 0x2033) + return "\""; + if (c == 0x2018 || c == 0x201b || c == 0x2019 || c == 0x2032) + return "'"; + if (c >= 0x2010 && c < 0x2014) + return "-"; + if (c == 0x2014) + return "--"; return "?"; } |