- string t = str;
-
- // Go through the character encoding only if the current
- // encoding (chset_->name()) matches the current font_norm
- // (lyrxc->font_norm
-
- if (chset_.getName() != lyxrc->font_norm ||
- chset_.encodeString(str) == false) {
- // Could not find an encoding
- InsetLatexAccent ins(str);
- if (ins.CanDisplay()) {
- text->InsertInset(new InsetLatexAccent(ins));
- return;
+ // 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;