#include "support/debug.h"
#include "support/lassert.h"
#include "support/lstrings.h"
+#include "support/textutils.h"
#include <vector>
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;
}
if (nextraw_) {
os_ << c;
nextraw_ = false;
- } else
- os_ << html::escapeChar(c);
+ } else {
+ string const d = html::escapeChar(c);
+ os_ << from_ascii(d);
+ }
return *this;
}