1 #ifndef MSP_STRINGCODEC_JISX0208_H_
2 #define MSP_STRINGCODEC_JISX0208_H_
7 namespace StringCodec {
10 Codec for the JIS X 0208 encoding. This is not particularly useful as a
11 stand-alone codec, due to lack of a linefeed character among other things,
12 but is included as part of some other encodings.
14 class JisX0208: public StandardCodec<JisX0208>
17 class Encoder: public Codec::Encoder
20 Encoder(ErrorMode em = THROW_ON_ERROR): Codec::Encoder(em) { }
22 virtual void encode_char(unichar, std::string &);
24 virtual void transliterate(unichar, std::string &);
27 class Decoder: public Codec::Decoder
30 Decoder(ErrorMode em = THROW_ON_ERROR): Codec::Decoder(em) { }
32 virtual unichar decode_char(const std::string &, std::string::const_iterator &);
35 JisX0208(ErrorMode em = THROW_ON_ERROR): StandardCodec<JisX0208>(em) { }
37 virtual const char *get_name() const { return "JIS X 0208"; }
46 Kuten(): ku(0), ten(0) { }
48 operator bool() { return ku!=0 && ten!=0; }
51 unichar jisx0208_to_ucs(Kuten);
52 Kuten ucs_to_jisx0208(unichar);
54 } // namespace StringCodec