diff --git a/ChangeLog b/ChangeLog index 683a4f23..7acb4a8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-03-30 Markus Gans + * Fixed bug: termcap "me" does not reset + the alternate character set + 2017-03-28 Markus Gans * Improved graphic charset pairs (vt100) for FreeBSD console diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index d4d6acb2..92bbc640 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -529,18 +529,26 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next) if ( hasNoAttribute(next) ) { - if ( off.pc_charset ) - unsetTermPCcharset(term); - - if ( off.alt_charset ) - unsetTermAltCharset(term); - if ( hasAttribute(term) ) { if ( F_exit_attribute_mode.cap ) + { unsetTermAttributes(term); + + if ( off.pc_charset ) + unsetTermPCcharset(term); + + if ( off.alt_charset ) + unsetTermAltCharset(term); + } else { + if ( off.pc_charset ) + unsetTermPCcharset(term); + + if ( off.alt_charset ) + unsetTermAltCharset(term); + if ( off.bold ) unsetTermBold(term); @@ -579,11 +587,8 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next) if ( colorChange(term, next) ) change_color (term, next); } - else if ( F_set_attributes.cap ) + else if ( F_set_attributes.cap && ! term->pc_charset ) { - if ( off.pc_charset ) - unsetTermPCcharset(term); - if ( switchOn() || switchOff() ) setTermAttributes ( term , next->standout @@ -596,6 +601,9 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next) , next->protect , next->alt_charset ); + if ( off.pc_charset ) + unsetTermPCcharset(term); + if ( next->italic ) setTermItalic(term); @@ -676,12 +684,12 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next) detectSwitchOn (term, next); - if ( on.pc_charset ) - setTermPCcharset(term); - if ( on.alt_charset ) setTermAltCharset(term); + if ( on.pc_charset ) + setTermPCcharset(term); + if ( on.bold ) setTermBold(term); diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 8cdb1ecc..687dfda5 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -2545,17 +2545,17 @@ inline void FVTerm::charsetChanges (char_data*& next_char) return; uInt code = uInt(next_char->code); - uInt ch = charEncode(code); + uInt ch_enc = charEncode(code); - if ( ch != code ) + if ( ch_enc != code ) { - if ( ch == 0 ) + if ( ch_enc == 0 ) { next_char->code = int(charEncode(code, fc::ASCII)); return; } - next_char->code = int(ch); + next_char->code = int(ch_enc); if ( Encoding == fc::VT100 ) next_char->alt_charset = true; @@ -2563,7 +2563,7 @@ inline void FVTerm::charsetChanges (char_data*& next_char) { next_char->pc_charset = true; - if ( isXTerminal() && hasUTF8() && ch < 0x20 ) // Character 0x00..0x1f + if ( isXTerminal() && hasUTF8() && ch_enc < 0x20 ) // Character 0x00..0x1f next_char->code = int(charEncode(code, fc::ASCII)); } }