void Iso88591::Encoder::encode_char(unichar ch, string &buf)
{
if(ch<0 || ch>0xFF)
- return error(ch, buf, "Can't express character in ISO-8859-1");
+ return error(ch, buf, invalid_character(ch, "ISO-8859-1"));
buf += ch;
}
unichar Iso88591::Decoder::decode_char(const string &str, string::const_iterator &i)
{
if(i==str.end())
- return error("No input");
+ return -1;
return static_cast<unsigned char>(*i++);
}