3 This file is part of libmspstrings
4 Copyright © 2006-2007 Mikko Rasa
5 Distributed under the LGPL
8 #ifndef MSP_STRINGS_JISX0208_H_
9 #define MSP_STRINGS_JISX0208_H_
17 Codec for the JIS X 0208 encoding. This is not particularly useful as a
18 stand-alone codec, due to lack of a linefeed character among other things,
19 but is included as part of some other encodings.
21 class JisX0208: public Codec
24 class Encoder: public Codec::Encoder
27 Encoder(ErrorMode em=THROW_ON_ERROR): Codec::Encoder(em) { }
28 virtual void encode_char(UnicodeChar, std::string &);
30 virtual void transliterate(UnicodeChar, std::string &);
33 class Decoder: public Codec::Decoder
36 Decoder(ErrorMode em=THROW_ON_ERROR): Codec::Decoder(em) { }
37 virtual UnicodeChar decode_char(const std::string &, std::string::const_iterator &);
40 Encoder *create_encoder(ErrorMode em=THROW_ON_ERROR) const { return new Encoder(em); }
41 Decoder *create_decoder(ErrorMode em=THROW_ON_ERROR) const { return new Decoder(em); }
49 Kuten(): ku(0), ten(0) { }
50 operator bool() { return ku!=0 && ten!=0; }
53 extern UnicodeChar jisx0208_to_ucs(Kuten);
54 extern Kuten ucs_to_jisx0208(UnicodeChar);