From 7225ddf9df514c6c88ecbe01c708137a324456c7 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 8 Aug 2017 13:41:31 +0200 Subject: Add FZ_REPLACEMENT_CHARACTER define for U+FFFD character. --- source/pdf/pdf-encoding.c | 2 +- source/pdf/pdf-op-run.c | 2 +- source/pdf/pdf-parse.c | 2 +- source/pdf/pdf-type3.c | 2 +- source/pdf/pdf-unicode.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/pdf') diff --git a/source/pdf/pdf-encoding.c b/source/pdf/pdf-encoding.c index ac2f1a55..0b2cdfca 100644 --- a/source/pdf/pdf-encoding.c +++ b/source/pdf/pdf-encoding.c @@ -63,7 +63,7 @@ pdf_lookup_agl(const char *name) else if (buf[0] == 'a' && buf[1] != 0 && buf[2] != 0) code = strtol(buf + 1, NULL, 10); - return (code > 0 && code <= 0x10ffff) ? code : 0xFFFD; + return (code > 0 && code <= 0x10ffff) ? code : FZ_REPLACEMENT_CHARACTER; } static const char *empty_dup_list[] = { 0 }; diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c index 8a0ba446..f088139e 100644 --- a/source/pdf/pdf-op-run.c +++ b/source/pdf/pdf-op-run.c @@ -909,7 +909,7 @@ pdf_show_char(fz_context *ctx, pdf_run_processor *pr, int cid) } if (ucslen == 0 || (ucslen == 1 && ucsbuf[0] == 0)) { - ucsbuf[0] = 0xFFFD; + ucsbuf[0] = FZ_REPLACEMENT_CHARACTER; ucslen = 1; } diff --git a/source/pdf/pdf-parse.c b/source/pdf/pdf-parse.c index e75baa60..084ffc19 100644 --- a/source/pdf/pdf-parse.c +++ b/source/pdf/pdf-parse.c @@ -54,7 +54,7 @@ rune_from_utf16be(int *out, unsigned char *s, unsigned char *end) *out = a; return 2; } - *out = 0xFFFD; + *out = FZ_REPLACEMENT_CHARACTER; return 1; } diff --git a/source/pdf/pdf-type3.c b/source/pdf/pdf-type3.c index b7c10c4e..9701cf54 100644 --- a/source/pdf/pdf-type3.c +++ b/source/pdf/pdf-type3.c @@ -114,7 +114,7 @@ pdf_load_type3_font(fz_context *ctx, pdf_document *doc, pdf_obj *rdb, pdf_obj *d if (fontdesc->cid_to_ucs_len == 256) { for (i = 32; i < 127; ++i) - if (fontdesc->cid_to_ucs[i] == 0xFFFD) + if (fontdesc->cid_to_ucs[i] == FZ_REPLACEMENT_CHARACTER) fontdesc->cid_to_ucs[i] = i; } diff --git a/source/pdf/pdf-unicode.c b/source/pdf/pdf-unicode.c index c599b202..9cc378c8 100644 --- a/source/pdf/pdf-unicode.c +++ b/source/pdf/pdf-unicode.c @@ -107,7 +107,7 @@ pdf_load_to_unicode(fz_context *ctx, pdf_document *doc, pdf_font_desc *font, if (strings[cpt]) font->cid_to_ucs[cpt] = pdf_lookup_agl(strings[cpt]); else - font->cid_to_ucs[cpt] = 0xFFFD; /* replacement character */ + font->cid_to_ucs[cpt] = FZ_REPLACEMENT_CHARACTER; } } -- cgit v1.2.3