From 4127faacec2253d8fdd4eb00a1621b6bfa548ee6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 21 Apr 2021 22:02:18 -0400 Subject: [PATCH] substitute unicode general punctuation left/right single/double quotes --- src/utils.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/utils.cpp b/src/utils.cpp index e733d7eaae..e8f1c63606 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -673,6 +673,18 @@ std::string utils::utf8_subst(const std::string &line) // ZERO WIDTH SPACE (U+200B) if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x8bU)) out += ' ', i += 2; + // LEFT SINGLE QUOTATION MARK (U+2018) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x98U)) + out += '\'', i += 2; + // RIGHT SINGLE QUOTATION MARK (U+2019) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x99U)) + out += '\'', i += 2; + // LEFT DOUBLE QUOTATION MARK (U+201C) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x9cU)) + out += '"', i += 2; + // RIGHT DOUBLE QUOTATION MARK (U+201D) + if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x9dU)) + out += '"', i += 2; // NARROW NO-BREAK SPACE (U+202F) if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0xafU)) out += ' ', i += 2;