53 changed files with 3519 additions and 278 deletions
-
3ext/mbstring/config.m4
-
3ext/mbstring/config.w32
-
15ext/mbstring/libmbfl/AUTHORS
-
6ext/mbstring/libmbfl/Makefile.am
-
15ext/mbstring/libmbfl/configure.in
-
131ext/mbstring/libmbfl/filters/Makefile.am
-
51ext/mbstring/libmbfl/filters/Makefile.bcc32
-
156ext/mbstring/libmbfl/filters/mbfilter_cp1254.c
-
43ext/mbstring/libmbfl/filters/mbfilter_cp1254.h
-
146ext/mbstring/libmbfl/filters/mbfilter_koi8u.c
-
47ext/mbstring/libmbfl/filters/mbfilter_koi8u.h
-
BINext/mbstring/libmbfl/filters/unicode_table_cp1254.h
-
166ext/mbstring/libmbfl/filters/unicode_table_koi8u.h
-
12ext/mbstring/libmbfl/libmbfl.dsp
-
26ext/mbstring/libmbfl/libmbfl.sln
-
777ext/mbstring/libmbfl/libmbfl.vcproj
-
8ext/mbstring/libmbfl/mbfl.rc
-
29ext/mbstring/libmbfl/mbfl/Makefile.am
-
13ext/mbstring/libmbfl/mbfl/Makefile.bcc32
-
7ext/mbstring/libmbfl/mbfl/mbfilter.h
-
2ext/mbstring/libmbfl/mbfl/mbfilter_8bit.h
-
4ext/mbstring/libmbfl/mbfl/mbfilter_pass.h
-
2ext/mbstring/libmbfl/mbfl/mbfilter_wchar.h
-
4ext/mbstring/libmbfl/mbfl/mbfl_consts.h
-
6ext/mbstring/libmbfl/mbfl/mbfl_convert.c
-
24ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
-
2ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
-
4ext/mbstring/libmbfl/mbfl/mbfl_ident.c
-
2ext/mbstring/libmbfl/mbfl/mbfl_language.c
-
1ext/mbstring/libmbfl/mbfl/mbfl_language.h
-
23ext/mbstring/libmbfl/nls/Makefile.am
-
12ext/mbstring/libmbfl/nls/Makefile.bcc32
-
2ext/mbstring/libmbfl/nls/nls_ru.c
-
22ext/mbstring/libmbfl/nls/nls_ua.c
-
9ext/mbstring/libmbfl/nls/nls_ua.h
-
10ext/mbstring/libmbfl/tests/Makefile.am
-
104ext/mbstring/libmbfl/tests/conv_encoding.c
-
1ext/mbstring/libmbfl/tests/conv_encoding.tests/Makefile.am
-
33ext/mbstring/libmbfl/tests/conv_encoding.tests/cp51932_cp50220raw.exp
-
35ext/mbstring/libmbfl/tests/conv_encoding.tests/ujis_sjis.exp
-
35ext/mbstring/libmbfl/tests/conv_encoding.tests/utf8_sjis.exp
-
147ext/mbstring/libmbfl/tests/conv_kana.c
-
1ext/mbstring/libmbfl/tests/conv_kana.tests/Makefile.am
-
1098ext/mbstring/libmbfl/tests/conv_kana.tests/conv_kana.exp
-
113ext/mbstring/libmbfl/tests/strcut.c
-
1ext/mbstring/libmbfl/tests/strcut.tests/Makefile.am
-
129ext/mbstring/libmbfl/tests/strcut.tests/iso2022jp.exp
-
91ext/mbstring/libmbfl/tests/strcut.tests/ujis.exp
-
91ext/mbstring/libmbfl/tests/strcut.tests/utf8.exp
-
79ext/mbstring/libmbfl/tests/strwidth.c
-
1ext/mbstring/libmbfl/tests/strwidth.tests/Makefile.am
-
47ext/mbstring/libmbfl/tests/strwidth.tests/strwidth.exp
-
8ext/mbstring/mbstring.c
@ -1,10 +1,13 @@ |
|||
Den V. Tsopa <tdv@edisoft.ru> |
|||
Hironori Sato <satoh@jpnnet.com> |
|||
Marcus Boerger <helly@php.net> |
|||
Moriyoshi Koizumi <moriyoshi@php.net> |
|||
Hayk Chamyan <hamshen@gmail.com> |
|||
Wez Furlong <wez@thebrainroom.com> |
|||
Rui Hirokawa <hirokawa@php.net> |
|||
Shigeru Kanemoto <sgk@happysize.co.jp> |
|||
Tsukada Takuya <tsukada@fminn.nagano.nagano.jp> |
|||
Tateyama <tateyan@amy.hi-ho.ne.jp> |
|||
U. Kenkichi <kenkichi@axes.co.jp> |
|||
Wez Furlong <wez@thebrainroom.com> |
|||
Moriyoshi Koizumi <moriyoshi@php.net> |
|||
Hironori Sato <satoh@jpnnet.com> |
|||
Tsukada Takuya <tsukada@fminn.nagano.nagano.jp> |
|||
Tateyama <tateyan@amy.hi-ho.ne.jp> |
|||
Den V. Tsopa <tdv@edisoft.ru> |
|||
Maksym Veremeyenko <verem@m1stereo.tv> |
|||
Haluk AKIN <halukakin@gmail.com> |
|||
@ -1,5 +1,9 @@ |
|||
AUTOMAKE_OPTIONS=dejagnu |
|||
DEJATOOL=conv_encoding conv_kana strwidth strcut |
|||
RUNTESTDEFAULTFLAGS=--tool $$tool --srcdir "$$srcdir"/tests |
|||
LANG=C |
|||
EXTRA_DIST=AUTHORS DISCLAIMER LICENSE Makefile.bcc32 \
|
|||
config.h.bcc32 config.h.vc6 \
|
|||
libmbfl.dsp libmbfl.dsw libmbfl.sln libmbfl.vcproj mbfl.rc \
|
|||
mksbcc32.bat rules.mak.bcc32 |
|||
SUBDIRS = nls filters mbfl |
|||
SUBDIRS = nls filters mbfl tests |
|||
@ -0,0 +1,156 @@ |
|||
/* |
|||
* "streamable kanji code filter and converter" |
|||
* Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. |
|||
* |
|||
* LICENSE NOTICES |
|||
* |
|||
* This file is part of "streamable kanji code filter and converter", |
|||
* which is distributed under the terms of GNU Lesser General Public |
|||
* License (version 2) as published by the Free Software Foundation. |
|||
* |
|||
* This software is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Lesser General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Lesser General Public |
|||
* License along with "streamable kanji code filter and converter"; |
|||
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
* Suite 330, Boston, MA 02111-1307 USA |
|||
* |
|||
* The author of this part: Haluk AKIN <halukakin@gmail.com> |
|||
* |
|||
*/ |
|||
/* |
|||
* the source code included in this files was separated from mbfilter.c |
|||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002. |
|||
* |
|||
*/ |
|||
|
|||
#ifdef HAVE_CONFIG_H |
|||
#include "config.h" |
|||
#endif |
|||
|
|||
#include "mbfilter.h" |
|||
#include "mbfilter_cp1254.h" |
|||
#include "unicode_table_cp1254.h" |
|||
|
|||
static int mbfl_filt_ident_cp1254(int c, mbfl_identify_filter *filter); |
|||
|
|||
static const char *mbfl_encoding_cp1254_aliases[] = {"CP1254", "CP-1254", "WINDOWS-1254", NULL}; |
|||
|
|||
const mbfl_encoding mbfl_encoding_cp1254 = { |
|||
mbfl_no_encoding_cp1254, |
|||
"Windows-1254", |
|||
"Windows-1254", |
|||
(const char *(*)[])&mbfl_encoding_cp1254_aliases, |
|||
NULL, |
|||
MBFL_ENCTYPE_SBCS |
|||
}; |
|||
|
|||
const struct mbfl_identify_vtbl vtbl_identify_cp1254 = { |
|||
mbfl_no_encoding_cp1254, |
|||
mbfl_filt_ident_common_ctor, |
|||
mbfl_filt_ident_common_dtor, |
|||
mbfl_filt_ident_cp1254 |
|||
}; |
|||
|
|||
const struct mbfl_convert_vtbl vtbl_cp1254_wchar = { |
|||
mbfl_no_encoding_cp1254, |
|||
mbfl_no_encoding_wchar, |
|||
mbfl_filt_conv_common_ctor, |
|||
mbfl_filt_conv_common_dtor, |
|||
mbfl_filt_conv_cp1254_wchar, |
|||
mbfl_filt_conv_common_flush |
|||
}; |
|||
|
|||
const struct mbfl_convert_vtbl vtbl_wchar_cp1254 = { |
|||
mbfl_no_encoding_wchar, |
|||
mbfl_no_encoding_cp1254, |
|||
mbfl_filt_conv_common_ctor, |
|||
mbfl_filt_conv_common_dtor, |
|||
mbfl_filt_conv_wchar_cp1254, |
|||
mbfl_filt_conv_common_flush |
|||
}; |
|||
|
|||
#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) |
|||
|
|||
/* |
|||
* wchar => cp1254 |
|||
*/ |
|||
int mbfl_filt_conv_wchar_cp1254(int c, mbfl_convert_filter *filter) |
|||
{ |
|||
int s=-1, n; |
|||
|
|||
if (c < 0x80) { |
|||
s = c; |
|||
} else { |
|||
/* look it up from the cp1254 table */ |
|||
s = -1; |
|||
n = cp1254_ucs_table_len-1; |
|||
while (n >= 0) { |
|||
if (c == cp1254_ucs_table[n] && c != 0xfffe) { |
|||
s = cp1254_ucs_table_min + n; |
|||
break; |
|||
} |
|||
n--; |
|||
} |
|||
if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP1254) |
|||
{ |
|||
s = c & MBFL_WCSPLANE_MASK; |
|||
} |
|||
} |
|||
|
|||
if (s >= 0) { |
|||
CK((*filter->output_function)(s, filter->data)); |
|||
} else { |
|||
if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { |
|||
CK(mbfl_filt_conv_illegal_output(c, filter)); |
|||
} |
|||
} |
|||
return c; |
|||
} |
|||
|
|||
/* |
|||
* cp1254 => wchar |
|||
*/ |
|||
int mbfl_filt_conv_cp1254_wchar(int c, mbfl_convert_filter *filter) |
|||
{ |
|||
int s; |
|||
|
|||
if ( c >= 0 && c < cp1254_ucs_table_min) { |
|||
s = c; |
|||
} else if (c >= cp1254_ucs_table_min && c < 0x100) { |
|||
s = cp1254_ucs_table[c - cp1254_ucs_table_min]; |
|||
if (s <= 0) { |
|||
s = c; |
|||
s &= MBFL_WCSPLANE_MASK; |
|||
s |= MBFL_WCSPLANE_CP1254; |
|||
} |
|||
} else { |
|||
s = c; |
|||
s &= MBFL_WCSGROUP_MASK; |
|||
s |= MBFL_WCSGROUP_THROUGH; |
|||
} |
|||
|
|||
CK((*filter->output_function)(s, filter->data)); |
|||
|
|||
return c; |
|||
} |
|||
|
|||
/* We only distinguish the MS extensions to ISO-8859-1. |
|||
* Actually, this is pretty much a NO-OP, since the identification |
|||
* system doesn't allow us to discriminate between a positive match, |
|||
* a possible match and a definite non-match. |
|||
* The problem here is that cp1254 looks like SJIS for certain chars. |
|||
* */ |
|||
static int mbfl_filt_ident_cp1254(int c, mbfl_identify_filter *filter) |
|||
{ |
|||
if (c >= 0x80 && c < 0xff) |
|||
filter->flag = 0; |
|||
else |
|||
filter->flag = 1; /* not it */ |
|||
return c; |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,43 @@ |
|||
/* |
|||
* "streamable kanji code filter and converter" |
|||
* Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. |
|||
* |
|||
* LICENSE NOTICES |
|||
* |
|||
* This file is part of "streamable kanji code filter and converter", |
|||
* which is distributed under the terms of GNU Lesser General Public |
|||
* License (version 2) as published by the Free Software Foundation. |
|||
* |
|||
* This software is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Lesser General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Lesser General Public |
|||
* License along with "streamable kanji code filter and converter"; |
|||
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
* Suite 330, Boston, MA 02111-1307 USA |
|||
* |
|||
* The author of this part: Haluk AKIN <halukakin@gmail.com> |
|||
* |
|||
*/ |
|||
/* |
|||
* the source code included in this files was separated from mbfilter.c |
|||
* by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002. |
|||
* |
|||
*/ |
|||
|
|||
#ifndef MBFL_MBFILTER_CP1254_H |
|||
#define MBFL_MBFILTER_CP1254_H |
|||
|
|||
#include "mbfilter.h" |
|||
|
|||
extern const mbfl_encoding mbfl_encoding_cp1254; |
|||
extern const struct mbfl_identify_vtbl vtbl_identify_cp1254; |
|||
extern const struct mbfl_convert_vtbl vtbl_cp1254_wchar; |
|||
extern const struct mbfl_convert_vtbl vtbl_wchar_cp1254; |
|||
|
|||
int mbfl_filt_conv_wchar_cp1254(int c, mbfl_convert_filter *filter); |
|||
int mbfl_filt_conv_cp1254_wchar(int c, mbfl_convert_filter *filter); |
|||
|
|||
#endif /* MBFL_MBFILTER_CP1254_H */ |
|||
@ -0,0 +1,146 @@ |
|||
/* |
|||
* "streamable kanji code filter and converter" |
|||
* Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. |
|||
* |
|||
* LICENSE NOTICES |
|||
* |
|||
* This file is part of "streamable kanji code filter and converter", |
|||
* which is distributed under the terms of GNU Lesser General Public |
|||
* License (version 2) as published by the Free Software Foundation. |
|||
* |
|||
* This software is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Lesser General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Lesser General Public |
|||
* License along with "streamable kanji code filter and converter"; |
|||
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
* Suite 330, Boston, MA 02111-1307 USA |
|||
* |
|||
* The author of this part: Maksym Veremeyenko <verem@m1.tv> |
|||
* |
|||
* Based on mbfilter_koi8r.c code |
|||
* |
|||
*/ |
|||
|
|||
#ifdef HAVE_CONFIG_H |
|||
#include "config.h" |
|||
#endif |
|||
|
|||
#include "mbfilter.h" |
|||
#include "mbfilter_koi8u.h" |
|||
#include "unicode_table_koi8u.h" |
|||
|
|||
static int mbfl_filt_ident_koi8u(int c, mbfl_identify_filter *filter); |
|||
|
|||
static const char *mbfl_encoding_koi8u_aliases[] = {"KOI8-U", "KOI8U", NULL}; |
|||
|
|||
const mbfl_encoding mbfl_encoding_koi8u = { |
|||
mbfl_no_encoding_koi8u, |
|||
"KOI8-U", |
|||
"KOI8-U", |
|||
(const char *(*)[])&mbfl_encoding_koi8u_aliases, |
|||
NULL, |
|||
MBFL_ENCTYPE_SBCS |
|||
}; |
|||
|
|||
const struct mbfl_identify_vtbl vtbl_identify_koi8u = { |
|||
mbfl_no_encoding_koi8u, |
|||
mbfl_filt_ident_common_ctor, |
|||
mbfl_filt_ident_common_dtor, |
|||
mbfl_filt_ident_koi8u |
|||
}; |
|||
|
|||
const struct mbfl_convert_vtbl vtbl_wchar_koi8u = { |
|||
mbfl_no_encoding_wchar, |
|||
mbfl_no_encoding_koi8u, |
|||
mbfl_filt_conv_common_ctor, |
|||
mbfl_filt_conv_common_dtor, |
|||
mbfl_filt_conv_wchar_koi8u, |
|||
mbfl_filt_conv_common_flush |
|||
}; |
|||
|
|||
const struct mbfl_convert_vtbl vtbl_koi8u_wchar = { |
|||
mbfl_no_encoding_koi8u, |
|||
mbfl_no_encoding_wchar, |
|||
mbfl_filt_conv_common_ctor, |
|||
mbfl_filt_conv_common_dtor, |
|||
mbfl_filt_conv_koi8u_wchar, |
|||
mbfl_filt_conv_common_flush |
|||
}; |
|||
|
|||
#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) |
|||
|
|||
/* |
|||
* koi8u => wchar |
|||
*/ |
|||
int |
|||
mbfl_filt_conv_koi8u_wchar(int c, mbfl_convert_filter *filter) |
|||
{ |
|||
int s; |
|||
|
|||
if (c >= 0 && c < koi8u_ucs_table_min) { |
|||
s = c; |
|||
} else if (c >= koi8u_ucs_table_min && c < 0x100) { |
|||
s = koi8u_ucs_table[c - koi8u_ucs_table_min]; |
|||
if (s <= 0) { |
|||
s = c; |
|||
s &= MBFL_WCSPLANE_MASK; |
|||
s |= MBFL_WCSPLANE_KOI8U; |
|||
} |
|||
} else { |
|||
s = c; |
|||
s &= MBFL_WCSGROUP_MASK; |
|||
s |= MBFL_WCSGROUP_THROUGH; |
|||
} |
|||
|
|||
CK((*filter->output_function)(s, filter->data)); |
|||
|
|||
return c; |
|||
} |
|||
|
|||
/* |
|||
* wchar => koi8u |
|||
*/ |
|||
int |
|||
mbfl_filt_conv_wchar_koi8u(int c, mbfl_convert_filter *filter) |
|||
{ |
|||
int s, n; |
|||
|
|||
if (c < 0x80) { |
|||
s = c; |
|||
} else { |
|||
s = -1; |
|||
n = koi8u_ucs_table_len-1; |
|||
while (n >= 0) { |
|||
if (c == koi8u_ucs_table[n]) { |
|||
s = koi8u_ucs_table_min + n; |
|||
break; |
|||
} |
|||
n--; |
|||
} |
|||
if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_KOI8U) { |
|||
s = c & MBFL_WCSPLANE_MASK; |
|||
} |
|||
} |
|||
|
|||
if (s >= 0) { |
|||
CK((*filter->output_function)(s, filter->data)); |
|||
} else { |
|||
if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) { |
|||
CK(mbfl_filt_conv_illegal_output(c, filter)); |
|||
} |
|||
} |
|||
|
|||
return c; |
|||
} |
|||
|
|||
static int mbfl_filt_ident_koi8u(int c, mbfl_identify_filter *filter) |
|||
{ |
|||
if (c >= 0x80 && c < 0xff) |
|||
filter->flag = 0; |
|||
else |
|||
filter->flag = 1; /* not it */ |
|||
return c; |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
/* |
|||
* "streamable kanji code filter and converter" |
|||
* Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. |
|||
* |
|||
* LICENSE NOTICES |
|||
* |
|||
* This file is part of "streamable kanji code filter and converter", |
|||
* which is distributed under the terms of GNU Lesser General Public |
|||
* License (version 2) as published by the Free Software Foundation. |
|||
* |
|||
* This software is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Lesser General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Lesser General Public |
|||
* License along with "streamable kanji code filter and converter"; |
|||
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
* Suite 330, Boston, MA 02111-1307 USA |
|||
* |
|||
* The author of this part: Maksym Veremeyenko <verem@m1.tv> |
|||
* |
|||
* Based on mbfilter_koi8r.h code |
|||
* |
|||
*/ |
|||
|
|||
#ifndef MBFL_MBFILTER_KOI8U_H |
|||
#define MBFL_MBFILTER_KOI8U_H |
|||
|
|||
#include "mbfilter.h" |
|||
|
|||
extern const mbfl_encoding mbfl_encoding_koi8u; |
|||
extern const struct mbfl_identify_vtbl vtbl_identify_koi8u; |
|||
extern const struct mbfl_convert_vtbl vtbl_wchar_koi8u; |
|||
extern const struct mbfl_convert_vtbl vtbl_koi8u_wchar; |
|||
|
|||
int mbfl_filt_conv_koi8u_wchar(int c, mbfl_convert_filter *filter); |
|||
int mbfl_filt_conv_wchar_koi8u(int c, mbfl_convert_filter *filter); |
|||
|
|||
#endif /* MBFL_MBFILTER_KOI8U_H */ |
|||
|
|||
/* |
|||
* Local variables: |
|||
* tab-width: 4 |
|||
* c-basic-offset: 4 |
|||
* End: |
|||
*/ |
|||
@ -0,0 +1,166 @@ |
|||
/* |
|||
* "streamable kanji code filter and converter" |
|||
* Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. |
|||
* |
|||
* LICENSE NOTICES |
|||
* |
|||
* This file is part of "streamable kanji code filter and converter", |
|||
* which is distributed under the terms of GNU Lesser General Public |
|||
* License (version 2) as published by the Free Software Foundation. |
|||
* |
|||
* This software is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Lesser General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Lesser General Public |
|||
* License along with "streamable kanji code filter and converter"; |
|||
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, |
|||
* Suite 330, Boston, MA 02111-1307 USA |
|||
* |
|||
* The author of this part: Maksym Veremeyenko <verem@m1.tv> |
|||
* |
|||
*/ |
|||
|
|||
#ifndef UNICODE_TABLE_KOI8U_H |
|||
#define UNICODE_TABLE_KOI8U_H |
|||
|
|||
/* KOI8-U (RFC2319) to Unicode */ |
|||
static const unsigned short koi8u_ucs_table[] = { |
|||
0x2500, /* BOX DRAWINGS LIGHT HORIZONTAL */ |
|||
0x2502, /* BOX DRAWINGS LIGHT VERTICAL */ |
|||
0x250C, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ |
|||
0x2510, /* BOX DRAWINGS LIGHT DOWN AND LEFT */ |
|||
0x2514, /* BOX DRAWINGS LIGHT UP AND RIGHT */ |
|||
0x2518, /* BOX DRAWINGS LIGHT UP AND LEFT */ |
|||
0x251C, /* BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ |
|||
0x2524, /* BOX DRAWINGS LIGHT VERTICAL AND LEFT */ |
|||
0x252C, /* BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ |
|||
0x2534, /* BOX DRAWINGS LIGHT UP AND HORIZONTAL */ |
|||
0x253C, /* BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ |
|||
0x2580, /* UPPER HALF BLOCK */ |
|||
0x2584, /* LOWER HALF BLOCK */ |
|||
0x2588, /* FULL BLOCK */ |
|||
0x258C, /* LEFT HALF BLOCK */ |
|||
0x2590, /* RIGHT HALF BLOCK */ |
|||
0x2591, /* LIGHT SHADE */ |
|||
0x2592, /* MEDIUM SHADE */ |
|||
0x2593, /* DARK SHADE */ |
|||
0x2320, /* TOP HALF INTEGRAL */ |
|||
0x25A0, /* BLACK SQUARE */ |
|||
0x2219, /* BULLET OPERATOR */ |
|||
0x221A, /* SQUARE ROOT */ |
|||
0x2248, /* ALMOST EQUAL TO */ |
|||
0x2264, /* LESS THAN OR EQUAL TO */ |
|||
0x2265, /* GREATER THAN OR EQUAL TO */ |
|||
0x00A0, /* NO-BREAK SPACE */ |
|||
0x2321, /* BOTTOM HALF INTEGRAL */ |
|||
0x00B0, /* DEGREE SIGN */ |
|||
0x00B2, /* SUPERSCRIPT TWO */ |
|||
0x00B7, /* MIDDLE DOT */ |
|||
0x00F7, /* DIVISION SIGN */ |
|||
0x2550, /* BOX DRAWINGS DOUBLE HORIZONTAL */ |
|||
0x2551, /* BOX DRAWINGS DOUBLE VERTICAL */ |
|||
0x2552, /* BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE */ |
|||
0x0451, /* CYRILLIC SMALL LETTER IO */ |
|||
0x0454, /* CYRILLIC SMALL LETTER UKRAINIAN IE */ |
|||
0x2554, /* BOX DRAWINGS DOUBLE DOWN AND RIGHT */ |
|||
0x0456, /* CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ |
|||
0x0457, /* CYRILLIC SMALL LETTER YI (UKRAINIAN) */ |
|||
0x2557, /* BOX DRAWINGS DOUBLE DOWN AND LEFT */ |
|||
0x2558, /* BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE */ |
|||
0x2559, /* BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE */ |
|||
0x255A, /* BOX DRAWINGS DOUBLE UP AND RIGHT */ |
|||
0x255B, /* BOX DRAWINGS UP SINGLE AND LEFT DOUBLE */ |
|||
0x0491, /* CYRILLIC SMALL LETTER GHE WITH UPTURN */ |
|||
0x255D, /* BOX DRAWINGS DOUBLE UP AND LEFT */ |
|||
0x255E, /* BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE */ |
|||
0x255F, /* BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE */ |
|||
0x2560, /* BOX DRAWINGS DOUBLE VERTICAL AND RIGHT */ |
|||
0x2561, /* BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE */ |
|||
0x0401, /* CYRILLIC CAPITAL LETTER IO */ |
|||
0x0404, /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ |
|||
0x2563, /* BOX DRAWINGS DOUBLE VERTICAL AND LEFT */ |
|||
0x0406, /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ |
|||
0x0407, /* CYRILLIC CAPITAL LETTER YI (UKRAINIAN) */ |
|||
0x2566, /* BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL */ |
|||
0x2567, /* BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE */ |
|||
0x2568, /* BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE */ |
|||
0x2569, /* BOX DRAWINGS DOUBLE UP AND HORIZONTAL */ |
|||
0x256A, /* BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE */ |
|||
0x0490, /* CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ |
|||
0x256C, /* BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL */ |
|||
0x00A9, /* COPYRIGHT SIGN */ |
|||
0x044E, /* CYRILLIC SMALL LETTER YU */ |
|||
0x0430, /* CYRILLIC SMALL LETTER A */ |
|||
0x0431, /* CYRILLIC SMALL LETTER BE */ |
|||
0x0446, /* CYRILLIC SMALL LETTER TSE */ |
|||
0x0434, /* CYRILLIC SMALL LETTER DE */ |
|||
0x0435, /* CYRILLIC SMALL LETTER IE */ |
|||
0x0444, /* CYRILLIC SMALL LETTER EF */ |
|||
0x0433, /* CYRILLIC SMALL LETTER GHE */ |
|||
0x0445, /* CYRILLIC SMALL LETTER KHA */ |
|||
0x0438, /* CYRILLIC SMALL LETTER I */ |
|||
0x0439, /* CYRILLIC SMALL LETTER SHORT I */ |
|||
0x043A, /* CYRILLIC SMALL LETTER KA */ |
|||
0x043B, /* CYRILLIC SMALL LETTER EL */ |
|||
0x043C, /* CYRILLIC SMALL LETTER EM */ |
|||
0x043D, /* CYRILLIC SMALL LETTER EN */ |
|||
0x043E, /* CYRILLIC SMALL LETTER O */ |
|||
0x043F, /* CYRILLIC SMALL LETTER PE */ |
|||
0x044F, /* CYRILLIC SMALL LETTER YA */ |
|||
0x0440, /* CYRILLIC SMALL LETTER ER */ |
|||
0x0441, /* CYRILLIC SMALL LETTER ES */ |
|||
0x0442, /* CYRILLIC SMALL LETTER TE */ |
|||
0x0443, /* CYRILLIC SMALL LETTER U */ |
|||
0x0436, /* CYRILLIC SMALL LETTER ZHE */ |
|||
0x0432, /* CYRILLIC SMALL LETTER VE */ |
|||
0x044C, /* CYRILLIC SMALL LETTER SOFT SIGN */ |
|||
0x044B, /* CYRILLIC SMALL LETTER YERU */ |
|||
0x0437, /* CYRILLIC SMALL LETTER ZE */ |
|||
0x0448, /* CYRILLIC SMALL LETTER SHA */ |
|||
0x044D, /* CYRILLIC SMALL LETTER E */ |
|||
0x0449, /* CYRILLIC SMALL LETTER SHCHA */ |
|||
0x0447, /* CYRILLIC SMALL LETTER CHE */ |
|||
0x044A, /* CYRILLIC SMALL LETTER HARD SIGN */ |
|||
0x042E, /* CYRILLIC CAPITAL LETTER YU */ |
|||
0x0410, /* CYRILLIC CAPITAL LETTER A */ |
|||
0x0411, /* CYRILLIC CAPITAL LETTER BE */ |
|||
0x0426, /* CYRILLIC CAPITAL LETTER TSE */ |
|||
0x0414, /* CYRILLIC CAPITAL LETTER DE */ |
|||
0x0415, /* CYRILLIC CAPITAL LETTER IE */ |
|||
0x0424, /* CYRILLIC CAPITAL LETTER EF */ |
|||
0x0413, /* CYRILLIC CAPITAL LETTER GHE */ |
|||
0x0425, /* CYRILLIC CAPITAL LETTER KHA */ |
|||
0x0418, /* CYRILLIC CAPITAL LETTER I */ |
|||
0x0419, /* CYRILLIC CAPITAL LETTER SHORT I */ |
|||
0x041A, /* CYRILLIC CAPITAL LETTER KA */ |
|||
0x041B, /* CYRILLIC CAPITAL LETTER EL */ |
|||
0x041C, /* CYRILLIC CAPITAL LETTER EM */ |
|||
0x041D, /* CYRILLIC CAPITAL LETTER EN */ |
|||
0x041E, /* CYRILLIC CAPITAL LETTER O */ |
|||
0x041F, /* CYRILLIC CAPITAL LETTER PE */ |
|||
0x042F, /* CYRILLIC CAPITAL LETTER YA */ |
|||
0x0420, /* CYRILLIC CAPITAL LETTER ER */ |
|||
0x0421, /* CYRILLIC CAPITAL LETTER ES */ |
|||
0x0422, /* CYRILLIC CAPITAL LETTER TE */ |
|||
0x0423, /* CYRILLIC CAPITAL LETTER U */ |
|||
0x0416, /* CYRILLIC CAPITAL LETTER ZHE */ |
|||
0x0412, /* CYRILLIC CAPITAL LETTER VE */ |
|||
0x042C, /* CYRILLIC CAPITAL LETTER SOFT SIGN */ |
|||
0x042B, /* CYRILLIC CAPITAL LETTER YERU */ |
|||
0x0417, /* CYRILLIC CAPITAL LETTER ZE */ |
|||
0x0428, /* CYRILLIC CAPITAL LETTER SHA */ |
|||
0x042D, /* CYRILLIC CAPITAL LETTER E */ |
|||
0x0429, /* CYRILLIC CAPITAL LETTER SHCHA */ |
|||
0x0427, /* CYRILLIC CAPITAL LETTER CHE */ |
|||
0x042A /* CYRILLIC CAPITAL LETTER HARD SIGN */ |
|||
}; |
|||
static const int koi8u_ucs_table_min = 0x80; |
|||
static const int koi8u_ucs_table_len = (sizeof (koi8u_ucs_table) / sizeof (unsigned short)); |
|||
static const int koi8u_ucs_table_max = 0x80 + (sizeof (koi8u_ucs_table) / sizeof (unsigned short)); |
|||
|
|||
|
|||
|
|||
#endif /* UNNICODE_TABLE_KOI8U_H */ |
|||
|
|||
@ -1,21 +1,19 @@ |
|||
Microsoft Visual Studio Solution File, Format Version 7.00 |
|||
Microsoft Visual Studio Solution File, Format Version 10.00 |
|||
# Visual C++ Express 2008 |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmbfl", "libmbfl.vcproj", "{B3636594-A785-4270-A765-8EAE922B5207}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfiguration) = preSolution |
|||
ConfigName.0 = Debug |
|||
ConfigName.1 = Release |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Win32 = Debug|Win32 |
|||
Release|Win32 = Release|Win32 |
|||
EndGlobalSection |
|||
GlobalSection(ProjectDependencies) = postSolution |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{B3636594-A785-4270-A765-8EAE922B5207}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{B3636594-A785-4270-A765-8EAE922B5207}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{B3636594-A785-4270-A765-8EAE922B5207}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{B3636594-A785-4270-A765-8EAE922B5207}.Release|Win32.Build.0 = Release|Win32 |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfiguration) = postSolution |
|||
{B3636594-A785-4270-A765-8EAE922B5207}.Debug.ActiveCfg = Debug|Win32 |
|||
{B3636594-A785-4270-A765-8EAE922B5207}.Debug.Build.0 = Debug|Win32 |
|||
{B3636594-A785-4270-A765-8EAE922B5207}.Release.ActiveCfg = Release|Win32 |
|||
{B3636594-A785-4270-A765-8EAE922B5207}.Release.Build.0 = Release|Win32 |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityGlobals) = postSolution |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityAddIns) = postSolution |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
EndGlobal |
|||
777
ext/mbstring/libmbfl/libmbfl.vcproj
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,22 @@ |
|||
#ifdef HAVE_CONFIG_H |
|||
#include "config.h" |
|||
#endif |
|||
|
|||
|
|||
#ifdef HAVE_STDDEF_H |
|||
#include <stddef.h> |
|||
#endif |
|||
|
|||
|
|||
#include "mbfilter.h" |
|||
#include "nls_ua.h" |
|||
|
|||
const mbfl_language mbfl_language_ukrainian = { |
|||
mbfl_no_language_ukrainian, |
|||
"Ukrainian", |
|||
"ua", |
|||
NULL, |
|||
mbfl_no_encoding_koi8u, |
|||
mbfl_no_encoding_qprint, |
|||
mbfl_no_encoding_8bit |
|||
}; |
|||
@ -0,0 +1,9 @@ |
|||
#ifndef MBFL_NLS_UA_H |
|||
#define MBFL_NLS_UA_H |
|||
|
|||
#include "mbfilter.h" |
|||
#include "nls_ua.h" |
|||
|
|||
extern const mbfl_language mbfl_language_ukrainian; |
|||
|
|||
#endif /* MBFL_NLS_UA_H */ |
|||
@ -0,0 +1,10 @@ |
|||
SUBDIRS=conv_encoding.tests conv_kana.tests strwidth.tests strcut.tests |
|||
noinst_PROGRAMS=conv_encoding conv_kana strwidth strcut |
|||
conv_encoding_SOURCES=conv_encoding.c |
|||
conv_encoding_LDADD=../mbfl/libmbfl.la |
|||
conv_kana_SOURCES=conv_kana.c |
|||
conv_kana_LDADD=../mbfl/libmbfl.la |
|||
strwidth_SOURCES=strwidth.c |
|||
strwidth_LDADD=../mbfl/libmbfl.la |
|||
strcut_SOURCES=strcut.c |
|||
strcut_LDADD=../mbfl/libmbfl.la |
|||
@ -0,0 +1,104 @@ |
|||
/** |
|||
* this is a small sample script to use libmbfl. |
|||
* Rui Hirokawa <hirokawa@php.net> |
|||
* |
|||
* this file is encoded in EUC-JP. |
|||
*/ |
|||
|
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <string.h> |
|||
#include "mbfl/mbfilter.h" |
|||
|
|||
static void hexdump(const mbfl_string *ptr) |
|||
{ |
|||
unsigned int i; |
|||
|
|||
for (i = 0; i < ptr->len; i++) { |
|||
printf("%%%02x", ptr->val[i]); |
|||
} |
|||
|
|||
printf(" (%u)\n", ptr->len); |
|||
} |
|||
|
|||
int main(int argc, char **argv) |
|||
{ |
|||
enum mbfl_no_encoding from_encoding, to_encoding; |
|||
enum mbfl_no_language no_language; |
|||
mbfl_buffer_converter *convd = NULL; |
|||
mbfl_memory_device dev; |
|||
mbfl_string string, result, *ret; |
|||
int final = 0; |
|||
int state = 0; |
|||
|
|||
if (argc < 4) { |
|||
fprintf(stderr, "Usage: %s lang to_encoding from_encoding\n", argv[0]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
if ((no_language = mbfl_name2no_language(argv[1])) == |
|||
mbfl_no_language_invalid) { |
|||
printf("Unsupported NLS: %s\n", argv[1]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
if ((to_encoding = mbfl_name2no_encoding(argv[2])) == |
|||
mbfl_no_encoding_invalid) { |
|||
printf("Unsupported encoding: %s\n", argv[2]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
if ((from_encoding = mbfl_name2no_encoding(argv[3])) == |
|||
mbfl_no_encoding_invalid) { |
|||
printf("Unsupported encoding: %s\n", argv[3]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
convd = mbfl_buffer_converter_new(from_encoding, to_encoding, 0); |
|||
|
|||
do { |
|||
mbfl_memory_device_init(&dev, 0, 4096); |
|||
mbfl_string_init_set(&string, no_language, from_encoding); |
|||
|
|||
for (;;) { |
|||
const int c = fgetc(stdin); |
|||
|
|||
if (c == EOF) { |
|||
final = 1; |
|||
break; |
|||
} else if (c == 10) { |
|||
if (state == 1) { |
|||
state = 0; |
|||
continue; |
|||
} |
|||
break; |
|||
} else if (c == 13) { |
|||
state = 1; |
|||
break; |
|||
} |
|||
|
|||
if (dev.pos >= dev.length) { |
|||
if (dev.length + dev.allocsz < dev.length) { |
|||
printf("Unable to allocate memory\n"); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
mbfl_memory_device_realloc(&dev, dev.length + dev.allocsz, |
|||
dev.allocsz); |
|||
} |
|||
|
|||
dev.buffer[dev.pos++] = (unsigned char)c; |
|||
} |
|||
|
|||
mbfl_memory_device_result(&dev, &string); |
|||
mbfl_string_init_set(&result, no_language, to_encoding); |
|||
ret = mbfl_buffer_converter_feed_result(convd, &string, &result); |
|||
hexdump(&result); |
|||
mbfl_string_clear(&result); |
|||
mbfl_string_clear(&string); |
|||
} while (!final); |
|||
|
|||
mbfl_buffer_converter_delete(convd); |
|||
|
|||
return EXIT_SUCCESS; |
|||
} |
|||
@ -0,0 +1 @@ |
|||
EXTRA_DIST=*.exp |
|||
@ -0,0 +1,33 @@ |
|||
#!/usr/bin/expect -f |
|||
spawn tests/conv_encoding Japanese CP50220raw eucJP-win |
|||
set timeout 1 |
|||
|
|||
expect_after { |
|||
"\[^\r\n\]*\r\n" { fail $test } |
|||
} |
|||
|
|||
set test "81 - 87ku" |
|||
send "\xf5\xba\xf6\xec\xf7\xc9\xf8\xb3\xf9\xa1\xfa\xa1\xfb\xa1\r" |
|||
expect { |
|||
"%1b%24%42%75%3a%76%6c%77%49%78%33%79%21%7a%21%7b%21%1b%28%42 (20)\r\n" { pass $test } |
|||
} |
|||
|
|||
|
|||
set test "kanji + kana" |
|||
send "日本語テスト\r" |
|||
expect { |
|||
"%1b%24%42%46%7c%4b%5c%38%6c%25%46%25%39%25%48%1b%28%42 (18)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "full-width numerics" |
|||
send "0123456789\r" |
|||
expect { |
|||
"%1b%24%42%23%30%23%31%23%32%23%33%23%34%23%35%23%36%23%37%23%38%23%39%1b%28%42 (26)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "full-width numerics" |
|||
send "㍊" |
|||
expect { |
|||
"%1b%24%42%2d%42%1b%28%42 (8)\r\n" { pass $test } |
|||
} |
|||
|
|||
@ -0,0 +1,35 @@ |
|||
#!/usr/bin/expect -f |
|||
spawn tests/conv_encoding Japanese Shift_JIS EUC-JP |
|||
set timeout 1 |
|||
|
|||
expect_after { |
|||
"\[^\r\n\]*\r\n" { fail $test } |
|||
} |
|||
|
|||
set test "basic test" |
|||
send "testtest\r" |
|||
expect { |
|||
"%74%65%73%74%74%65%73%74 (8)\r\n" { pass $test } |
|||
} |
|||
|
|||
|
|||
set test "kanji + kana" |
|||
send "日本語テスト\r" |
|||
expect { |
|||
"%93%fa%96%7b%8c%ea%83%65%83%58%83%67 (12)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "full-width numerics" |
|||
send "0123456789\r" |
|||
expect { |
|||
"%82%4f%82%50%82%51%82%52%82%53%82%54%82%55%82%56%82%57%82%58 (20)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "full-width numerics" |
|||
send "㍊" |
|||
expect { |
|||
"%3f (1)\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
# vim: sts=4 ts=4 sw=4 et encoding=EUC-JP |
|||
@ -0,0 +1,35 @@ |
|||
#!/usr/bin/expect -f |
|||
spawn tests/conv_encoding Japanese Shift_JIS UTF-8 |
|||
set timeout 1 |
|||
|
|||
expect_after { |
|||
"\[^\r\n\]*\r\n" { fail $test } |
|||
} |
|||
|
|||
set test "basic test" |
|||
send "testtest\r" |
|||
expect { |
|||
"%74%65%73%74%74%65%73%74 (8)\r\n" { pass $test } |
|||
} |
|||
|
|||
|
|||
set test "kanji + kana" |
|||
send "日本語テスト\r" |
|||
expect { |
|||
"%93%fa%96%7b%8c%ea%83%65%83%58%83%67 (12)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "full-width numerics" |
|||
send "0123456789\r" |
|||
expect { |
|||
"%82%4f%82%50%82%51%82%52%82%53%82%54%82%55%82%56%82%57%82%58 (20)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "full-width numerics" |
|||
send "㍊" |
|||
expect { |
|||
"%3f (1)\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
# vim: sts=4 ts=4 sw=4 et encoding=EUC-JP |
|||
@ -0,0 +1,147 @@ |
|||
/** |
|||
* this is a small sample script to use libmbfl. |
|||
* Rui Hirokawa <hirokawa@php.net> |
|||
* |
|||
* this file is encoded in EUC-JP. |
|||
*/ |
|||
|
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <string.h> |
|||
#include "mbfl/mbfilter.h" |
|||
|
|||
static void hexdump(const mbfl_string *ptr) |
|||
{ |
|||
unsigned int i; |
|||
|
|||
for (i = 0; i < ptr->len; i++) { |
|||
printf("%%%02x", ptr->val[i]); |
|||
} |
|||
|
|||
printf(" (%u)\n", ptr->len); |
|||
} |
|||
|
|||
int main(int argc, char **argv) |
|||
{ |
|||
enum mbfl_no_encoding no_enc; |
|||
const enum mbfl_no_language no_lang = mbfl_no_language_japanese; |
|||
mbfl_memory_device dev; |
|||
mbfl_string string, result; |
|||
int final = 0; |
|||
int state = 0; |
|||
int mode = 0; |
|||
|
|||
if (argc < 3) { |
|||
fprintf(stderr, "Usage: %s encoding flags\n", argv[0]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
if ((no_enc = mbfl_name2no_encoding(argv[1])) == |
|||
mbfl_no_encoding_invalid) { |
|||
printf("Unsupported encoding: %s\n", argv[1]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
{ |
|||
const char *p; |
|||
|
|||
for (p= argv[2] + strlen(argv[2]); p > argv[2]; ) { |
|||
switch (*(--p)) { |
|||
case 'A': |
|||
mode |= 0x1; |
|||
break; |
|||
case 'a': |
|||
mode |= 0x10; |
|||
break; |
|||
case 'R': |
|||
mode |= 0x2; |
|||
break; |
|||
case 'r': |
|||
mode |= 0x20; |
|||
break; |
|||
case 'N': |
|||
mode |= 0x4; |
|||
break; |
|||
case 'n': |
|||
mode |= 0x40; |
|||
break; |
|||
case 'S': |
|||
mode |= 0x8; |
|||
break; |
|||
case 's': |
|||
mode |= 0x80; |
|||
break; |
|||
case 'K': |
|||
mode |= 0x100; |
|||
break; |
|||
case 'k': |
|||
mode |= 0x1000; |
|||
break; |
|||
case 'H': |
|||
mode |= 0x200; |
|||
break; |
|||
case 'h': |
|||
mode |= 0x2000; |
|||
break; |
|||
case 'V': |
|||
mode |= 0x800; |
|||
break; |
|||
case 'C': |
|||
mode |= 0x10000; |
|||
break; |
|||
case 'c': |
|||
mode |= 0x20000; |
|||
break; |
|||
case 'M': |
|||
mode |= 0x100000; |
|||
break; |
|||
case 'm': |
|||
mode |= 0x200000; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
do { |
|||
mbfl_memory_device_init(&dev, 0, 4096); |
|||
mbfl_string_init_set(&string, no_lang, no_enc); |
|||
|
|||
for (;;) { |
|||
const int c = fgetc(stdin); |
|||
|
|||
if (c == EOF) { |
|||
final = 1; |
|||
break; |
|||
} else if (c == 10) { |
|||
if (state == 1) { |
|||
state = 0; |
|||
continue; |
|||
} |
|||
break; |
|||
} else if (c == 13) { |
|||
state = 1; |
|||
break; |
|||
} |
|||
|
|||
if (dev.pos >= dev.length) { |
|||
if (dev.length + dev.allocsz < dev.length) { |
|||
printf("Unable to allocate memory\n"); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
mbfl_memory_device_realloc(&dev, dev.length + dev.allocsz, |
|||
dev.allocsz); |
|||
} |
|||
|
|||
dev.buffer[dev.pos++] = (unsigned char)c; |
|||
} |
|||
|
|||
mbfl_memory_device_result(&dev, &string); |
|||
mbfl_ja_jp_hantozen(&string, &result, mode); |
|||
hexdump(&result); |
|||
mbfl_string_clear(&result); |
|||
mbfl_string_clear(&string); |
|||
} while (!final); |
|||
|
|||
return EXIT_SUCCESS; |
|||
} |
|||
@ -0,0 +1 @@ |
|||
EXTRA_DIST=*.exp |
|||
1098
ext/mbstring/libmbfl/tests/conv_kana.tests/conv_kana.exp
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,113 @@ |
|||
/** |
|||
* this is a small sample script to use libmbfl. |
|||
* Rui Hirokawa <hirokawa@php.net> |
|||
* |
|||
* this file is encoded in EUC-JP. |
|||
*/ |
|||
|
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <string.h> |
|||
#include <errno.h> |
|||
#include "mbfl/mbfilter.h" |
|||
|
|||
static void hexdump(const mbfl_string *ptr) |
|||
{ |
|||
unsigned int i; |
|||
|
|||
for (i = 0; i < ptr->len; i++) { |
|||
printf("%%%02x", ptr->val[i]); |
|||
} |
|||
|
|||
printf(" (%u)\n", ptr->len); |
|||
} |
|||
|
|||
int main(int argc, char **argv) |
|||
{ |
|||
enum mbfl_no_encoding no_encoding; |
|||
enum mbfl_no_language no_language; |
|||
mbfl_memory_device dev; |
|||
mbfl_string string; |
|||
int offset, length; |
|||
int final = 0; |
|||
int state = 0; |
|||
|
|||
if (argc < 5) { |
|||
fprintf(stderr, "Usage: %s lang encoding offset length\n", argv[0]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
if ((no_language = mbfl_name2no_language(argv[1])) == |
|||
mbfl_no_language_invalid) { |
|||
printf("Unsupported NLS: %s\n", argv[1]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
if ((no_encoding = mbfl_name2no_encoding(argv[2])) == |
|||
mbfl_no_encoding_invalid) { |
|||
printf("Unsupported encoding: %s\n", argv[2]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
errno = 0; |
|||
offset = strtol(argv[3], NULL, 10); |
|||
if (errno) { |
|||
printf("Invalid offset: %s\n", argv[3]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
length = strtol(argv[4], NULL, 10); |
|||
if (errno) { |
|||
printf("Invalid length: %s\n", argv[4]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
|
|||
do { |
|||
mbfl_string result; |
|||
|
|||
mbfl_memory_device_init(&dev, 0, 4096); |
|||
mbfl_string_init_set(&string, no_language, no_encoding); |
|||
|
|||
for (;;) { |
|||
const int c = fgetc(stdin); |
|||
|
|||
if (c == EOF) { |
|||
final = 1; |
|||
break; |
|||
} else if (c == 10) { |
|||
if (state == 1) { |
|||
state = 0; |
|||
continue; |
|||
} |
|||
break; |
|||
} else if (c == 13) { |
|||
state = 1; |
|||
break; |
|||
} |
|||
|
|||
if (dev.pos >= dev.length) { |
|||
if (dev.length + dev.allocsz < dev.length) { |
|||
printf("Unable to allocate memory\n"); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
mbfl_memory_device_realloc(&dev, dev.length + dev.allocsz, |
|||
dev.allocsz); |
|||
} |
|||
|
|||
dev.buffer[dev.pos++] = (unsigned char)c; |
|||
} |
|||
|
|||
mbfl_memory_device_result(&dev, &string); |
|||
if (mbfl_strcut(&string, &result, offset, length)) { |
|||
hexdump(&result); |
|||
mbfl_string_clear(&result); |
|||
} else { |
|||
printf("***ERROR***\n"); |
|||
} |
|||
mbfl_string_clear(&string); |
|||
} while (!final); |
|||
|
|||
return EXIT_SUCCESS; |
|||
} |
|||
@ -0,0 +1 @@ |
|||
EXTRA_DIST=*.exp |
|||
@ -0,0 +1,129 @@ |
|||
#!/usr/bin/expect -f |
|||
proc begin_strcut_test {_from _length} { |
|||
global spawn_id from length |
|||
set from $_from |
|||
set length $_length |
|||
|
|||
spawn tests/strcut Japanese "ISO-2022-JP" $_from $_length |
|||
set timeout 10 |
|||
|
|||
expect_after { |
|||
"\[^\r\n\]*\r\n" { fail $test } |
|||
} |
|||
} |
|||
|
|||
begin_strcut_test -1 2 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "\x1b\$B%F%9%H%F%9%H\x1b(B\r" |
|||
sleep 1 |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 2 -1 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "\x1b\$B%F%9%H%F%9%H\x1b(B\r" |
|||
sleep 1 |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 3 2 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "%74%74 (2)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "\x1b\$B%F%9%H%F%9%H\x1b(B\r" |
|||
sleep 1 |
|||
expect { |
|||
-ex " (0)\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 5 8 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "%65%73%74 (3)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
sleep 1 |
|||
send "\x1b\$B%F%9%H%F%9%H\x1b(B\r" |
|||
sleep 1 |
|||
expect { |
|||
-ex "%1b%24%42%25%39%1b%28%42 (8)\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 1 15 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testestestestestes\r" |
|||
expect { |
|||
"%65%73%74%65%73%74%65%73%74%65%73%74%65%73%74 (15)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "\x1b\$B%F%9%H%F%9%H\x1b(B\r" |
|||
sleep 1 |
|||
expect { |
|||
-ex "%1b%24%42%25%46%25%39%25%48%25%46%1b%28%42 (14)\r\n" { pass $test } |
|||
} |
|||
close |
|||
begin_strcut_test 8 20 |
|||
|
|||
set test "non-asciish characters (2) ($from, $length)" |
|||
send "\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x24\x46\x24\x39\x24\x48\x1b\x28\x49\x4a\x5e\x4a\x5e\x4a\x5e\x43\x3d\x44\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\r" |
|||
sleep 1 |
|||
expect { |
|||
-ex "%74%1b%24%42%25%39%1b%28%42%74%1b%24%42%25%48%24%46%1b%28%42 (20)\r\n" { |
|||
pass $test |
|||
} |
|||
} |
|||
|
|||
begin_strcut_test 8 21 |
|||
|
|||
set test "non-asciish characters (2) ($from, $length)" |
|||
sleep 1 |
|||
send "\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x24\x46\x24\x39\x24\x48\x1b\x28\x49\x4a\x5e\x4a\x5e\x4a\x5e\x43\x3d\x44\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\r" |
|||
expect { |
|||
-ex "%74%1b%24%42%25%39%1b%28%42%74%1b%24%42%25%48%24%46%1b%28%42 (20)\r\n" { |
|||
pass $test |
|||
} |
|||
} |
|||
|
|||
begin_strcut_test 11 17 |
|||
|
|||
set test "non-asciish characters (2) ($from, $length)" |
|||
sleep 1 |
|||
send "\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x24\x46\x24\x39\x24\x48\x1b\x28\x49\x4a\x5e\x4a\x5e\x4a\x5e\x43\x3d\x44\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\x1b\x24\x42\x25\x46\x1b\x28\x42\x74\x1b\x24\x42\x25\x39\x1b\x28\x42\x74\x1b\x24\x42\x25\x48\x1b\x28\x42\x74\r" |
|||
expect { |
|||
-ex "%1b%24%42%25%39%1b%28%42%74%1b%24%42%25%48%1b%28%42 (17)\r\n" { |
|||
pass $test |
|||
} |
|||
} |
|||
|
|||
|
|||
# vim: sts=4 sw=4 ts=4 et |
|||
@ -0,0 +1,91 @@ |
|||
#!/usr/bin/expect -f |
|||
proc begin_strcut_test {_from _length} { |
|||
global spawn_id from length |
|||
set from $_from |
|||
set length $_length |
|||
|
|||
spawn tests/strcut Japanese EUC-JP $_from $_length |
|||
set timeout 1 |
|||
|
|||
expect_after { |
|||
"\[^\r\n\]*\r\n" { fail $test } |
|||
} |
|||
} |
|||
|
|||
begin_strcut_test -1 2 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 2 -1 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 3 2 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "%74%74 (2)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "%a5%b9 (2)\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 5 8 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "%65%73%74 (3)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "%a5%c8%a5%c6%a5%b9%a5%c8 (8)\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 1 15 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testestestestestes\r" |
|||
expect { |
|||
"%65%73%74%65%73%74%65%73%74%65%73%74%65%73%74 (15)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "%a5%c6%a5%b9%a5%c8%a5%c6%a5%b9%a5%c8 (12)\r\n" { pass $test } |
|||
} |
|||
close |
|||
|
|||
|
|||
# vim: sts=4 sw=4 ts=4 et encoding=EUC-JP |
|||
@ -0,0 +1,91 @@ |
|||
#!/usr/bin/expect -f |
|||
proc begin_strcut_test {_from _length} { |
|||
global spawn_id from length |
|||
set from $_from |
|||
set length $_length |
|||
|
|||
spawn tests/strcut Japanese UTF-8 $_from $_length |
|||
set timeout 1 |
|||
|
|||
expect_after { |
|||
"\[^\r\n\]*\r\n" { fail $test } |
|||
} |
|||
} |
|||
|
|||
begin_strcut_test -1 2 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 2 -1 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "***ERROR***\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 3 2 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "%74%74 (2)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "(0)\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 5 8 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testtest\r" |
|||
expect { |
|||
-ex "%65%73%74 (3)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "%e3%82%b9%e3%83%88 (6)\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
begin_strcut_test 1 15 |
|||
|
|||
set test "asciish characters ($from, $length)" |
|||
send "testestestestestes\r" |
|||
expect { |
|||
"%65%73%74%65%73%74%65%73%74%65%73%74%65%73%74 (15)\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "non-asciish characters ($from, $length)" |
|||
send "テストテスト\r" |
|||
expect { |
|||
-ex "%e3%83%86%e3%82%b9%e3%83%88%e3%83%86%e3%82%b9 (15)\r\n" { pass $test } |
|||
} |
|||
close |
|||
|
|||
|
|||
# vim: sts=4 sw=4 ts=4 et encoding=UTF-8 |
|||
@ -0,0 +1,79 @@ |
|||
/** |
|||
* this is a small sample script to use libmbfl. |
|||
* Rui Hirokawa <hirokawa@php.net> |
|||
* |
|||
* this file is encoded in EUC-JP. |
|||
*/ |
|||
|
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <string.h> |
|||
#include "mbfl/mbfilter.h" |
|||
|
|||
int main(int argc, char **argv) |
|||
{ |
|||
enum mbfl_no_encoding no_encoding; |
|||
enum mbfl_no_language no_language; |
|||
mbfl_memory_device dev; |
|||
mbfl_string string; |
|||
int final = 0; |
|||
int state = 0; |
|||
|
|||
if (argc < 3) { |
|||
fprintf(stderr, "Usage: %s lang encoding\n", argv[0]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
if ((no_language = mbfl_name2no_language(argv[1])) == |
|||
mbfl_no_language_invalid) { |
|||
printf("Unsupported NLS: %s\n", argv[1]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
if ((no_encoding = mbfl_name2no_encoding(argv[2])) == |
|||
mbfl_no_encoding_invalid) { |
|||
printf("Unsupported encoding: %s\n", argv[2]); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
do { |
|||
mbfl_memory_device_init(&dev, 0, 4096); |
|||
mbfl_string_init_set(&string, no_language, no_encoding); |
|||
|
|||
for (;;) { |
|||
const int c = fgetc(stdin); |
|||
|
|||
if (c == EOF) { |
|||
final = 1; |
|||
break; |
|||
} else if (c == 10) { |
|||
if (state == 1) { |
|||
state = 0; |
|||
continue; |
|||
} |
|||
break; |
|||
} else if (c == 13) { |
|||
state = 1; |
|||
break; |
|||
} |
|||
|
|||
if (dev.pos >= dev.length) { |
|||
if (dev.length + dev.allocsz < dev.length) { |
|||
printf("Unable to allocate memory\n"); |
|||
return EXIT_FAILURE; |
|||
} |
|||
|
|||
mbfl_memory_device_realloc(&dev, dev.length + dev.allocsz, |
|||
dev.allocsz); |
|||
} |
|||
|
|||
dev.buffer[dev.pos++] = (unsigned char)c; |
|||
} |
|||
|
|||
mbfl_memory_device_result(&dev, &string); |
|||
printf("%d\n", mbfl_strwidth(&string)); |
|||
mbfl_string_clear(&string); |
|||
} while (!final); |
|||
|
|||
return EXIT_SUCCESS; |
|||
} |
|||
@ -0,0 +1 @@ |
|||
EXTRA_DIST=*.exp |
|||
@ -0,0 +1,47 @@ |
|||
#!/usr/bin/expect -f |
|||
spawn tests/strwidth Japanese UTF-8 |
|||
set timeout 1 |
|||
|
|||
expect_after { |
|||
"\[^\r\n\]*\r\n" { fail $test } |
|||
} |
|||
|
|||
set test "basic test" |
|||
send "testtest\r" |
|||
expect { |
|||
"8\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "CJK kanji" |
|||
send "漢字\r" |
|||
expect { |
|||
"4\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "CJK hiragana" |
|||
send "ひらがな\r" |
|||
expect { |
|||
"8\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "CJK katakana" |
|||
send "カタカナ\r" |
|||
expect { |
|||
"8\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "Fullwidth symbols (1)" |
|||
send "〜!”#$%&’())\r" |
|||
expect { |
|||
"20\r\n" { pass $test } |
|||
} |
|||
|
|||
set test "Halfwidth symbols assumed to be fullwidth in JISX0208 (2)" |
|||
send "○●◎\r" |
|||
expect { |
|||
"3\r\n" { pass $test } |
|||
} |
|||
|
|||
close |
|||
|
|||
# vim: sts=4 sw=4 ts=4 et encoding=UTF-8 |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue