]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/iso885915.cpp
Return -1 from decode_char if there is no input
[libs/core.git] / source / stringcodec / iso885915.cpp
index 3e71f753afcfdfdc6ce1c57c75378cb1f01c9cad..8dfc3a1e91a5c178e26461d686ea1bb340f76ce9 100644 (file)
@@ -44,19 +44,10 @@ void Iso885915::Encoder::transliterate(unichar, string &buf)
 unichar Iso885915::Decoder::decode_char(const string &str, string::const_iterator &i)
 {
        if(i==str.end())
-               return error("No input");
+               return -1;
 
-       unsigned char ch = *i;
-       int tch = transform_mapping_or_direct(mapping, map_size, ch, true);
-
-       unichar result;
-       if(tch==-1)
-               result = error("Undefined ISO-8859-15 character");
-       else
-               result = tch;
-
-       ++i;
-       return result;
+       unsigned char ch = *i++;
+       return transform_mapping_or_direct(mapping, map_size, ch, true);
 }
 
 } // namespace StringCodec