aboutsummaryrefslogtreecommitdiffstats
path: root/entity.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-01-02 00:20:47 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-01-02 00:20:47 +0000
commita722a562112506c63c9b6519b8252d633534a35a (patch)
tree78dc4b8bbefa910007339970eaf004f012d2082f /entity.c
parentSwitch upstream to Debian's w3m (diff)
parentNew upstream version 0.5.3+git20210102 (diff)
downloadw3m-a722a562112506c63c9b6519b8252d633534a35a.tar.gz
w3m-a722a562112506c63c9b6519b8252d633534a35a.zip
Update upstream source from tag 'upstream/0.5.3+git20210102'
Update to upstream version '0.5.3+git20210102' with Debian dir e89c066385156d7c9ed01b0c8a1a08e01019959d
Diffstat (limited to 'entity.c')
-rw-r--r--entity.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/entity.c b/entity.c
index fdd8f64..67b8cfb 100644
--- a/entity.c
+++ b/entity.c
@@ -44,6 +44,8 @@ conv_entity(unsigned int c)
return " ";
if (c == 0xa0)
return NBSP;
+ if (c == 0xad) /* SOFT HYPHEN */
+ return "";
if (c < 0x100) { /* Latin1 (ISO 8859-1) */
if (UseAltEntity)
return alt_latin1[c - 0xa0];
@@ -56,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 "?";
}