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 = DEFAULT): Codec::Encoder(em) { }
22 void encode_char(unichar, std::string &) override;
24 void transliterate(unichar, std::string &) override;
27 class Decoder: public Codec::Decoder
30 Decoder(ErrorMode em = DEFAULT): Codec::Decoder(em) { }
32 unichar decode_char(const std::string &, std::string::const_iterator &) override;
35 JisX0208(ErrorMode em = DEFAULT): StandardCodec<JisX0208>(em) { }
37 const char *get_name() const override { return "JIS X 0208"; }
43 unsigned short ku = 0;
44 unsigned short ten = 0;
46 explicit operator bool() { return ku!=0 && ten!=0; }
49 unichar jisx0208_to_ucs(Kuten);
50 Kuten ucs_to_jisx0208(unichar);
52 } // namespace StringCodec