X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstringcodec%2Fjisx0201.cpp;h=307a681fdbcea1a42f8a4bed5b021e67a687ddb7;hb=02794ef3620d0d9cc3b8f1c0d8f2995c825fdf4f;hp=d3fe635ce90beda61e2f99cc8aef5fc88e0794e0;hpb=b42ed73a1b241c0e93ee03c43c4584b41c549bac;p=libs%2Fcore.git diff --git a/source/stringcodec/jisx0201.cpp b/source/stringcodec/jisx0201.cpp index d3fe635..307a681 100644 --- a/source/stringcodec/jisx0201.cpp +++ b/source/stringcodec/jisx0201.cpp @@ -1,18 +1,11 @@ -/* $Id$ - -This file is part of libmspstrings -Copyright © 2006-2007 Mikko Rasa -Distributed under the LGPL -*/ - #include "jisx0201.h" using namespace std; namespace Msp { -namespace Codecs { +namespace StringCodec { -void JisX0201::Encoder::encode_char(UnicodeChar ch, string &buf) +void JisX0201::Encoder::encode_char(unichar ch, string &buf) { if(ch>=0 && ch<=0x7F && ch!=0x5C && ch!=0x7E) buf += ch; @@ -26,19 +19,19 @@ void JisX0201::Encoder::encode_char(UnicodeChar ch, string &buf) error(ch, buf, "Can't express character in JIS X 0201"); } -void JisX0201::Encoder::transliterate(UnicodeChar, string &buf) +void JisX0201::Encoder::transliterate(unichar, string &buf) { buf += '?'; } -UnicodeChar JisX0201::Decoder::decode_char(const string &str, string::const_iterator &i) +unichar JisX0201::Decoder::decode_char(const string &str, string::const_iterator &i) { if(i==str.end()) return error("No input"); unsigned char ch = *i; - UnicodeChar result; + unichar result; if(ch==0x5C) result = 0xA5; else if(ch==0x7E) @@ -54,5 +47,5 @@ UnicodeChar JisX0201::Decoder::decode_char(const string &str, string::const_iter return result; } -} // namespace Codecs +} // namespace StringCodec } // namespace Msp