Fix unicode prime symbol to become a quotation mark.
authorCarl Hetherington <cth@carlh.net>
Mon, 18 Sep 2017 19:30:34 +0000 (20:30 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 18 Sep 2017 19:30:34 +0000 (20:30 +0100)
src/iso6937.cc
test/iso6937_test.cc

index 21637b320aa5c651b0f764b3517a048fd80a1c41..8409f9b00eabdfcfba37ee6246ccb542ef3801e3 100644 (file)
@@ -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;
index ccb21f2b234aaf02b25b585995832e3115a7f12a..3abd06d4f9e3ca393343935a18f5485c76fa2d7e 100644 (file)
@@ -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");
 }