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) { }
29 virtual void encode_char(UnicodeChar, std::string &);
31 virtual void transliterate(UnicodeChar, std::string &);
34 class Decoder: public Codec::Decoder
37 Decoder(ErrorMode em = THROW_ON_ERROR): Codec::Decoder(em) { }
39 virtual UnicodeChar decode_char(const std::string &, std::string::const_iterator &);
42 virtual const char *get_name() const { return "JIS X 0208"; }
44 virtual Encoder *create_encoder(ErrorMode em = THROW_ON_ERROR) const { return new Encoder(em); }
45 virtual Decoder *create_decoder(ErrorMode em = THROW_ON_ERROR) const { return new Decoder(em); }
54 Kuten(): ku(0), ten(0) { }
56 operator bool() { return ku!=0 && ten!=0; }
59 extern UnicodeChar jisx0208_to_ucs(Kuten);
60 extern Kuten ucs_to_jisx0208(UnicodeChar);