1 #ifndef MSP_STRINGS_UTF8_H_
2 #define MSP_STRINGS_UTF8_H_
8 class Utf8: public StringCodec
11 class Encoder: public StringCodec::Encoder
14 Encoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Encoder(em) { }
15 void encode_char(wchar_t);
17 void append_replacement() { append("\357\277\275"); }
20 class Decoder: public StringCodec::Decoder
23 Decoder(ErrorMode em=THROW_ON_ERROR): StringCodec::Decoder(em), bytes(0), code(0) { }
24 void decode_char(const std::string &, std::string::const_iterator &);
32 Encoder *create_encoder(ErrorMode em=THROW_ON_ERROR) const { return new Encoder(em); }
33 Decoder *create_decoder(ErrorMode em=THROW_ON_ERROR) const { return new Decoder(em); }