From f1cb36dddd59ea8430af367f7498da1062ad0e68 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 12 Aug 2016 10:14:45 +0100 Subject: Forward-port some STL fixes from libsub. --- src/iso6937.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/iso6937.cc b/src/iso6937.cc index 2b75116..21637b3 100644 --- a/src/iso6937.cc +++ b/src/iso6937.cc @@ -98,6 +98,22 @@ sub::utf16_to_iso6937 (wstring s) } } } + + if (s[i] == 0x201e) { + /* ISO6397 does not support German (lower) quotation mark (UTF 0x201e) so use + a normal opening one (0x201c, which is 170 in ISO6937). + */ + o += (char) 170; + } else if (s[i] == 0x2013 || s[i] == 0x2014) { + /* ISO6397 does not support en- or em-dashes, so use a horizontal bar (0x2015, + which is 208 in ISO6937). + */ + o += (char) 208; + } else if (s[i] == 0x2010 || s[i] == 0x2011 || s[i] == 0x2012) { + /* Similar story with hyphen, non-breaking hyphen, figure dash */ + o += '-'; + } + } return o; -- cgit v1.2.3