X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fiso2022jp.cpp;h=ab31456245b449c861a4c69b98dab62af77d4f40;hp=6a6bd1dc7970b28c367fbfad07d5719c505bc0ad;hb=51b84c0c2c3abb0cf7e815c5ae259face40ac977;hpb=5ea1720bc90416df7ac5e28b145e9ebf7f76b7a2 diff --git a/source/iso2022jp.cpp b/source/iso2022jp.cpp index 6a6bd1d..ab31456 100644 --- a/source/iso2022jp.cpp +++ b/source/iso2022jp.cpp @@ -72,7 +72,7 @@ void Iso2022Jp::Decoder::decode_char(const string &str, string::const_iterator & { if(escape) { - escape=escape<<8 | (unsigned char)*i; + escape=escape<<8 | static_cast(*i); if(*i>='@' && *i<='Z') { switch(escape) @@ -110,6 +110,12 @@ void Iso2022Jp::Decoder::sync() dec->flush(); } +void Iso2022Jp::Decoder::reset() +{ + switch_mode(ASCII); + escape=0; +} + void Iso2022Jp::Decoder::switch_mode(Mode m) { append(dec->get());