From eeb0a8a6d9a14876d5d8c14cd75196cb3639b86c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 18 Sep 2017 20:30:34 +0100 Subject: [PATCH] Fix unicode prime symbol to become a quotation mark. --- src/iso6937.cc | 4 +++- test/iso6937_test.cc | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/iso6937.cc b/src/iso6937.cc index 21637b3..8409f9b 100644 --- a/src/iso6937.cc +++ b/src/iso6937.cc @@ -112,8 +112,10 @@ sub::utf16_to_iso6937 (wstring s) } else if (s[i] == 0x2010 || s[i] == 0x2011 || s[i] == 0x2012) { /* Similar story with hyphen, non-breaking hyphen, figure dash */ o += '-'; + } else if (s[i] == 0x2032) { + /* And prime */ + o += '\''; } - } return o; diff --git a/test/iso6937_test.cc b/test/iso6937_test.cc index ccb21f2..3abd06d 100644 --- a/test/iso6937_test.cc +++ b/test/iso6937_test.cc @@ -41,4 +41,5 @@ BOOST_AUTO_TEST_CASE (utf16_to_iso6937_test) BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf ("All must have çedillas")), "All must have \xCB""cedillas"); BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf ("Mötorhead")), "M\xC8otorhead"); BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf ("Pass\nnewlines\nthrough")), "Pass\nnewlines\nthrough"); + BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf ("Ignore prime′s and just use quote's")), "Ignore prime's and just use quote's"); } -- 2.30.2