mirror of
https://github.com/php/php-src.git
synced 2026-03-29 03:32:20 +02:00
Add identify filter for ISO-8859-7 (Latin/Greek)
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
#include "mbfilter_iso8859_7.h"
|
||||
#include "unicode_table_iso8859_7.h"
|
||||
|
||||
static int mbfl_filt_ident_iso8859_7(int c, mbfl_identify_filter *filter);
|
||||
|
||||
static const char *mbfl_encoding_8859_7_aliases[] = {"ISO8859-7", "greek", NULL};
|
||||
|
||||
const mbfl_encoding mbfl_encoding_8859_7 = {
|
||||
@@ -47,7 +49,7 @@ const mbfl_encoding mbfl_encoding_8859_7 = {
|
||||
const struct mbfl_identify_vtbl vtbl_identify_8859_7 = {
|
||||
mbfl_no_encoding_8859_7,
|
||||
mbfl_filt_ident_common_ctor,
|
||||
mbfl_filt_ident_true
|
||||
mbfl_filt_ident_iso8859_7
|
||||
};
|
||||
|
||||
const struct mbfl_convert_vtbl vtbl_8859_7_wchar = {
|
||||
@@ -132,3 +134,11 @@ int mbfl_filt_conv_wchar_8859_7(int c, mbfl_convert_filter *filter)
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
static int mbfl_filt_ident_iso8859_7(int c, mbfl_identify_filter *filter)
|
||||
{
|
||||
/* These bytes are not mapped to any character in ISO-8859-7 */
|
||||
if (c == 0xAE || c == 0xD2 || c == 0xFF)
|
||||
filter->status = 1;
|
||||
return c;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user