diff --git a/dsl.cc b/dsl.cc index 1b706f80..ee97bbb2 100644 --- a/dsl.cc +++ b/dsl.cc @@ -1022,14 +1022,23 @@ string DslDictionary::nodeToHtml( ArticleDom::Node const & node ) title.reserve( i->second.size() ); for( char const * c = i->second.c_str(); *c; ++c ) + { if ( *c == ' ' || *c == '\t' ) { // u00A0 in utf8 title.push_back( 0xC2 ); title.push_back( 0xA0 ); } + else + if( *c == '-' ) // Change minus to non-breaking hyphen (uE28091 in utf8) + { + title.push_back( 0xE2 ); + title.push_back( 0x80 ); + title.push_back( 0x91 ); + } else title.push_back( *c ); + } } else title = i->second; diff --git a/xdxf2html.cc b/xdxf2html.cc index b7bd1fa6..4b486a19 100644 --- a/xdxf2html.cc +++ b/xdxf2html.cc @@ -348,14 +348,23 @@ string convert( string const & in, DICT_TYPE type, map < string, string > const title.reserve( i->second.size() ); for( char const * c = i->second.c_str(); *c; ++c ) + { if ( *c == ' ' || *c == '\t' ) { // u00A0 in utf8 title.push_back( 0xC2 ); title.push_back( 0xA0 ); } + else + if( *c == '-' ) // Change minus to non-breaking hyphen (uE28091 in utf8) + { + title.push_back( 0xE2 ); + title.push_back( 0x80 ); + title.push_back( 0x91 ); + } else title.push_back( *c ); + } } else title = i->second;