From 85ee87997e3ee4eb579084f92d109b9b78dcf9c7 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 25 Aug 2016 12:44:13 +0200 Subject: Use U+FFFD instead of '?' for bad encodings in text extraction. --- source/fitz/stext-search.c | 2 +- source/fitz/util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/fitz') diff --git a/source/fitz/stext-search.c b/source/fitz/stext-search.c index 4afbe6b7..2246f627 100644 --- a/source/fitz/stext-search.c +++ b/source/fitz/stext-search.c @@ -259,7 +259,7 @@ fz_copy_selection(fz_context *ctx, fz_stext_page *page, fz_rect rect) fz_stext_char_bbox(ctx, &hitbox, span, i); c = span->text[i].c; if (c < 32) - c = '?'; + c = 0xFFFD; if (hitbox.x1 >= x0 && hitbox.x0 <= x1 && hitbox.y1 >= y0 && hitbox.y0 <= y1) { fz_write_buffer_rune(ctx, buffer, c); diff --git a/source/fitz/util.c b/source/fitz/util.c index fc49d84f..4c7b3232 100644 --- a/source/fitz/util.c +++ b/source/fitz/util.c @@ -447,7 +447,7 @@ fz_new_buffer_from_stext_page(fz_context *ctx, fz_stext_page *text, const fz_rec fz_stext_char_bbox(ctx, &hitbox, span, i); c = span->text[i].c; if (c < 32) - c = '?'; + c = 0xFFFD; if (hitbox.x1 >= x0 && hitbox.x0 <= x1 && hitbox.y1 >= y0 && hitbox.y0 <= y1) { saw_text = 1; -- cgit v1.2.3