]> git.tdb.fi Git - libs/core.git/blob - source/stringcodec/iso88591.cpp
Additional adjustments for Poller
[libs/core.git] / source / stringcodec / iso88591.cpp
1 #include "iso88591.h"
2
3 using namespace std;
4
5 namespace Msp {
6 namespace StringCodec {
7
8 void Iso88591::Encoder::encode_char(unichar ch, string &buf)
9 {
10         if(ch<0 || ch>0xFF)
11                 return error(ch, buf, invalid_character(ch, "ISO-8859-1"));
12
13         buf += ch;
14 }
15
16 void Iso88591::Encoder::transliterate(unichar, string &buf)
17 {
18         buf += '?';
19 }
20
21
22 unichar Iso88591::Decoder::decode_char(const string &str, string::const_iterator &i)
23 {
24         if(i==str.end())
25                 return -1;
26
27         return static_cast<unsigned char>(*i++);
28 }
29
30 } // namespace StringCodec
31 } // namespace Msp