X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_xhtml.cpp;h=d8299ce5c4511a30df32133583a5f86fde4c6aa1;hb=fa8dae4201fc25da685a21de0f8968678df8f119;hp=c4792ae739d38092cdd11c19be4e22b6bfdc7e9c;hpb=ca9ff9e430359856aa995dbc9aac3e901973bb6a;p=lyx.git diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index c4792ae739..d8299ce5c4 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -32,6 +32,7 @@ #include "support/debug.h" #include "support/lassert.h" #include "support/lstrings.h" +#include "support/textutils.h" #include @@ -128,11 +129,10 @@ docstring cleanAttr(docstring const & str) docstring newname; docstring::const_iterator it = str.begin(); docstring::const_iterator en = str.end(); - for (; it != en; ++it) - if (isalnum(*it)) - newname += *it; - else - newname += '_'; + for (; it != en; ++it) { + char_type const c = *it; + newname += isAlnumASCII(c) ? c : char_type('_'); + } return newname; } @@ -292,8 +292,10 @@ XHTMLStream & XHTMLStream::operator<<(char c) if (nextraw_) { os_ << c; nextraw_ = false; - } else - os_ << html::escapeChar(c); + } else { + string const d = html::escapeChar(c); + os_ << from_ascii(d); + } return *this; }