summaryrefslogtreecommitdiff
path: root/enc/big5.c
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-17 08:56:11 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-17 08:56:11 +0000
commite0436c54c21343580d5fa6b9334fbfa20e10c646 ()
treece8cb2acce79871fe0e772e6121cbac279ccdf18 /enc/big5.c
parentfab47c96c50ad7c679e77e4ac86f6fb9137a427f (diff)
* enc/big5.c, enc/trans/big5.trans, enc/trans/big5-uao-tbl.rb,
test/ruby/test-transcode.rb: Added Encoding 'Big5-UAO' and transcoding for it (from Tatsuya Mizuno) (see Bug #1784) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--enc/big5.c51
1 files changed, 51 insertions, 0 deletions
@@ -67,6 +67,26 @@ static const int EncLen_BIG5_HKSCS[] = {
/* F */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
};
typedef enum { FAILURE = -2, ACCEPT = -1, S0 = 0, S1 } state_t;
#define A ACCEPT
#define F FAILURE
@@ -156,6 +176,12 @@ big5_hkscs_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUS
return big5_mbc_enc_len0(p, e, 2, EncLen_BIG5_HKSCS);
}
static OnigCodePoint
big5_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
@@ -211,6 +237,8 @@ static const char BIG5_CAN_BE_TRAIL_TABLE[256] = {
};
#define BIG5_HKSCS_P(enc) ((enc)->precise_mbc_enc_len == big5_hkscs_mbc_enc_len)
#define BIG5_ISMB_FIRST(byte) ( \
BIG5_HKSCS_P(enc) ? EncLen_BIG5_HKSCS[byte] > 1 : \
EncLen_BIG5[byte] > 1 \
@@ -300,3 +328,26 @@ OnigEncodingDefine(big5_hkscs, BIG5_HKSCS) = {
big5_is_allowed_reverse_match
};
ENC_ALIAS("CP951", "Big5-HKSCS")