+void TransManager::insert(string const & str, LyXText * text)
+{
+ // Go through the character encoding only if the current
+ // encoding (chset_->name()) matches the current font_norm
+ // (lyrxc->font_norm)
+
+ // Is false to speak about "only if" the current encoding will
+ // almost always be equal to font_norm.
+ pair<bool, int> enc = chset_.encodeString(str);
+ if (chset_.getName() != lyxrc.font_norm ||
+ !enc.first) {
+ // Could not find an encoding
+ InsetLatexAccent ins(str);
+ if (ins.canDisplay()) {
+ text->insertInset(current_view,
+ new InsetLatexAccent(ins));
+ } else {
+ insertVerbatim(str, text);
+ }
+ return;
+ }
+ string tmp;
+ tmp += static_cast<char>(enc.second);
+ insertVerbatim(tmp, text);
+}