-/* $Id$
-
-This file is part of libmspstrings
-Copyright © 2006-2007 Mikko Rasa
-Distributed under the LGPL
-*/
#include "ascii.h"
#include "iso2022jp.h"
#include "jisx0201.h"
using namespace std;
namespace Msp {
-namespace Codecs {
+namespace StringCodec {
-void Iso2022Jp::Encoder::encode_char(UnicodeChar ch, string &buf)
+void Iso2022Jp::Encoder::encode_char(unichar ch, string &buf)
{
if(ch>=0 && ch<=0x7F && ch!=0x5C && ch!=0x7E)
{
}
}
-void Iso2022Jp::Encoder::transliterate(UnicodeChar, string &buf)
+void Iso2022Jp::Encoder::transliterate(unichar, string &buf)
{
if(mode!=ASCII)
switch_mode(ASCII, buf);
dec(new Ascii::Decoder)
{ }
-UnicodeChar Iso2022Jp::Decoder::decode_char(const string &str, string::const_iterator &i)
+unichar Iso2022Jp::Decoder::decode_char(const string &str, string::const_iterator &i)
{
if(i==str.end())
- return error("No input");
+ return -1;
while(i!=str.end())
{
string::const_iterator j = i;
- UnicodeChar result = -1;
+ unichar result = -1;
if(*j==033)
{
unsigned escape = 0;
}
}
-} // namespace Codecs
+} // namespace StringCodec
} // namespace Msp