Big5CodingSystem.cxx revision 7c478bd95313f5f23a4c958a745db2134aa03244
// Copyright (c) 1997 James Clark
// See the file COPYING for copying permission.
#pragma ident "%Z%%M% %I% %E% SMI"
#include "splib.h"
#ifdef SP_MULTI_BYTE
#include "Big5CodingSystem.h"
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
class Big5Decoder : public Decoder {
public:
Big5Decoder() { }
private:
};
class Big5Encoder : public Encoder {
public:
Big5Encoder() { }
}
};
{
return new Big5Decoder;
}
{
return new Big5Encoder;
}
{
const unsigned char *us = (const unsigned char *)s;
while (slen > 0) {
if (!(*us & 0x80)) {
slen--;
}
else {
if (slen < 2)
break;
slen -= 2;
unsigned short n = *us++ << 8;
n |= *us++;
*to++ = n;
}
}
}
{
for (; n > 0; s++, n--) {
Char c = *s;
if (c < 0x80)
else if (c & 0x8000) {
}
else
handleUnencodable(c, sb);
}
}
#ifdef SP_NAMESPACE
}
#endif
#else /* not SP_MULTI_BYTE */
#ifndef __GNUG__
static char non_empty_translation_unit; // sigh
#endif
#endif /* not SP_MULTI_BYTE */