]> git.tdb.fi Git - libs/core.git/blob - source/latin1.cpp
Initial upload
[libs/core.git] / source / latin1.cpp
1 #include "latin1.h"
2
3 using namespace std;
4
5 namespace Msp {
6
7 void Latin1::Encoder::encode_char(wchar_t c)
8 {
9         if(c<0 || c>0xFF)
10                 throw CodecError("Can't express character in Latin-1");
11         append(c);
12 }
13
14 void Latin1::Decoder::decode_char(const string &str, string::const_iterator &i)
15 {
16         if(i==str.end())
17                 return;
18         append((unsigned char)*i++);
19 }
20
21 } // namespace Msp