Skip to content

Commit 5c6b2a7

Browse files
committed
Add identify filter for ISO-8859-8 (Latin/Hebrew)
1 parent ea68701 commit 5c6b2a7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "mbfilter_iso8859_8.h"
3232
#include "unicode_table_iso8859_8.h"
3333

34+
static int mbfl_filt_ident_iso8859_8(int c, mbfl_identify_filter *filter);
35+
3436
static const char *mbfl_encoding_8859_8_aliases[] = {"ISO8859-8", "hebrew", NULL};
3537

3638
const mbfl_encoding mbfl_encoding_8859_8 = {
@@ -47,7 +49,7 @@ const mbfl_encoding mbfl_encoding_8859_8 = {
4749
const struct mbfl_identify_vtbl vtbl_identify_8859_8 = {
4850
mbfl_no_encoding_8859_8,
4951
mbfl_filt_ident_common_ctor,
50-
mbfl_filt_ident_true
52+
mbfl_filt_ident_iso8859_8
5153
};
5254

5355
const struct mbfl_convert_vtbl vtbl_8859_8_wchar = {
@@ -131,3 +133,11 @@ int mbfl_filt_conv_wchar_8859_8(int c, mbfl_convert_filter *filter)
131133

132134
return c;
133135
}
136+
137+
static int mbfl_filt_ident_iso8859_8(int c, mbfl_identify_filter *filter)
138+
{
139+
if (c >= 0xA0 && !iso8859_8_ucs_table[c - 0xA0]) {
140+
filter->status = 1;
141+
}
142+
return c;
143+
}

0 commit comments

Comments
 (0)