summaryrefslogtreecommitdiff
path: root/bk_text.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-04-19 17:09:12 +0000
committerSimon Tatham <anakin@pobox.com>2004-04-19 17:09:12 +0000
commitf42941536c6c16ba8b89dd5f25d8a747e3d5495d (patch)
treeb2533971228e8aeca27debb8e0ebb2ce7a85c107 /bk_text.c
parentd74917688ba7d95ed71fe836091ec9d952f433e6 (diff)
downloadhalibut-f42941536c6c16ba8b89dd5f25d8a747e3d5495d.zip
halibut-f42941536c6c16ba8b89dd5f25d8a747e3d5495d.tar.gz
halibut-f42941536c6c16ba8b89dd5f25d8a747e3d5495d.tar.bz2
halibut-f42941536c6c16ba8b89dd5f25d8a747e3d5495d.tar.xz
Better robustness when backends encounter a Unicode character not
representable in the output character set. [originally from svn r4094]
Diffstat (limited to 'bk_text.c')
-rw-r--r--bk_text.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bk_text.c b/bk_text.c
index 359ea25..499f232 100644
--- a/bk_text.c
+++ b/bk_text.c
@@ -450,7 +450,7 @@ static void text_rdaddwc(rdstringc *rs, word *text, word *end) {
attraux(text->aux) == attr_Only))
rdaddc(rs, '`'); /* FIXME: configurability */
if (removeattr(text->type) == word_Normal) {
- if (text_convert(text->text, &c))
+ if (text_convert(text->text, &c) || !text->alt)
rdaddsc(rs, c);
else
text_rdaddwc(rs, text->alt, NULL);
@@ -505,7 +505,7 @@ static int text_width(void *ctx, word *text) {
? (attraux(text->aux) == attr_Only ? 2 :
attraux(text->aux) == attr_Always ? 0 : 1)
: 0) +
- (text_convert(text->text, NULL) ?
+ (text_convert(text->text, NULL) || !text->alt ?
ustrlen(text->text) :
text_width_list(ctx, text->alt)));