summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-09-18 20:30:34 +0100
committerCarl Hetherington <cth@carlh.net>2017-09-18 20:30:34 +0100
commiteeb0a8a6d9a14876d5d8c14cd75196cb3639b86c (patch)
tree0a29ba4209870b91ed55131edaedb82d66e28c2d
parentb24a12e276a4eeb39a45f2b8d63843fc3527a33d (diff)
Fix unicode prime symbol to become a quotation mark.
-rw-r--r--src/iso6937.cc4
-rw-r--r--test/iso6937_test.cc1
2 files changed, 4 insertions, 1 deletions
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<wchar_t> ("All must have çedillas")), "All must have \xCB""cedillas");
BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf<wchar_t> ("Mötorhead")), "M\xC8otorhead");
BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf<wchar_t> ("Pass\nnewlines\nthrough")), "Pass\nnewlines\nthrough");
+ BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf<wchar_t> ("Ignore prime′s and just use quote's")), "Ignore prime's and just use quote's");
}