diff options
Diffstat (limited to 'ext/mbstring/libmbfl/filters/mbfilter_uhc.c')
-rw-r--r-- | ext/mbstring/libmbfl/filters/mbfilter_uhc.c | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uhc.c b/ext/mbstring/libmbfl/filters/mbfilter_uhc.c index 5dc4aa81a9..447ec7c5e1 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_uhc.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_uhc.c @@ -32,8 +32,6 @@ #define UNICODE_TABLE_UHC_DEF #include "unicode_table_uhc.h" -static int mbfl_filt_ident_uhc(int c, mbfl_identify_filter *filter); - static const unsigned char mblen_table_uhc[] = { /* 0x81-0xFE */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -59,19 +57,13 @@ const mbfl_encoding mbfl_encoding_uhc = { mbfl_no_encoding_uhc, "UHC", "UHC", - (const char *(*)[])&mbfl_encoding_uhc_aliases, + mbfl_encoding_uhc_aliases, mblen_table_uhc, - MBFL_ENCTYPE_MBCS, + 0, &vtbl_uhc_wchar, &vtbl_wchar_uhc }; -const struct mbfl_identify_vtbl vtbl_identify_uhc = { - mbfl_no_encoding_uhc, - mbfl_filt_ident_common_ctor, - mbfl_filt_ident_uhc -}; - const struct mbfl_convert_vtbl vtbl_uhc_wchar = { mbfl_no_encoding_uhc, mbfl_no_encoding_wchar, @@ -220,43 +212,3 @@ mbfl_filt_conv_wchar_uhc(int c, mbfl_convert_filter *filter) return c; } - -static int mbfl_filt_ident_uhc(int c, mbfl_identify_filter *filter) -{ - switch (filter->status) { - case 0: /* latin */ - if (c >= 0 && c < 0x80) { /* ok */ - ; - } else if (c >= 0x81 && c <= 0xa0) { /* dbcs first char */ - filter->status= 1; - } else if (c >= 0xa1 && c <= 0xc6) { /* dbcs first char */ - filter->status= 2; - } else if (c >= 0xc7 && c <= 0xfe) { /* dbcs first char */ - filter->status= 3; - } else { /* bad */ - filter->flag = 1; - } - - case 1: - case 2: - if (c < 0x41 || (c > 0x5a && c < 0x61) - || (c > 0x7a && c < 0x81) || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - case 3: - if (c < 0xa1 || c > 0xfe) { /* bad */ - filter->flag = 1; - } - filter->status = 0; - break; - - default: - filter->status = 0; - break; - } - - return c; -} |