namespace Msp {
-void Ascii::Encoder::encode_char(wchar_t c)
+void Ascii::Encoder::encode_char(wchar_t c_)
{
+ // Win32 has typedef unsigned short wchar_t
+ int c=c_;
if(c<0 || c>0x7F)
- throw CodecError("Can't express character in ASCII");
- append(c);
+ error("Can't express character in ASCII");
+ else
+ append(c);
}
{
if(i==str.end())
return;
- if(*i&0x80)
- throw CodecError("Invalid ASCII string (undefined character)");
- append(*i++);
+ else if(*i&0x80)
+ {
+ error("Invalid ASCII string (undefined character)");
+ ++i;
+ }
+ else
+ append(*i++);
}
} // namespace Msp