File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ Makefile.in
8181/tests /oxcmail_ie
8282/tests /ucvttest
8383/tests /udb
84+ /tests /utf8filter
8485/tests /utiltest
8586/tests /vcard
8687/tests /zendfake
Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ mapi_la_LDFLAGS += -Wl,--allow-shlib-undefined
241241endif
242242EXTRA_mapi_la_DEPENDENCIES = default.sym
243243
244- noinst_PROGRAMS = dldcheck tests/bdump tests/bodyconv tests/compress tests/dnsbl_check tests/exrpctest tests/gxl-383 tests/jsontest tests/lzxpress tests/oxcmail_ie tests/ucvttest tests/udb tests/utiltest tests/vcard tools/tzdump
244+ noinst_PROGRAMS = dldcheck tests/bdump tests/bodyconv tests/compress tests/dnsbl_check tests/exrpctest tests/gxl-383 tests/jsontest tests/lzxpress tests/oxcmail_ie tests/ucvttest tests/udb tests/utf8filter tests/ utiltest tests/vcard tools/tzdump
245245if HAVE_ESEDB
246246noinst_PROGRAMS += tests/epv_unpack
247247endif
@@ -272,6 +272,8 @@ tests_oxcmail_ie_SOURCES = tests/oxcmail_ie.cpp
272272tests_oxcmail_ie_LDADD = ${libHX_LIBS} libgromox_common.la libgromox_mapi.la
273273tests_ucvttest_SOURCES = tests/ucvttest.cpp
274274tests_ucvttest_LDADD = libgromox_mapi.la
275+ tests_utf8filter_SOURCES = tests/utf8filter.cpp
276+ tests_utf8filter_LDADD = ${libHX_LIBS} libgromox_common.la
275277tests_utiltest_SOURCES = tests/utiltest.cpp
276278tests_utiltest_LDADD = ${libHX_LIBS} libgromox_common.la libgromox_mapi.la
277279tests_vcard_SOURCES = tests/vcard.cpp
Original file line number Diff line number Diff line change 1+ #include < cstdlib>
2+ #include < cstring>
3+ #include < memory>
4+ #include < libHX/io.h>
5+ #include < gromox/defs.h>
6+ #include < gromox/util.hpp>
7+ using namespace gromox ;
8+ int main (int argc, char **argv)
9+ {
10+ size_t size = 0 ;
11+ std::unique_ptr<char [], stdlib_delete> buf (HX_slurp_fd (STDIN_FILENO, &size));
12+ if (buf == nullptr )
13+ return EXIT_FAILURE;
14+ utf8_filter (buf.get ());
15+ auto z = strlen (buf.get ());
16+ auto ret = HXio_fullwrite (STDOUT_FILENO, buf.get (), z);
17+ if (ret < 0 || static_cast <size_t >(ret) != z)
18+ return EXIT_FAILURE;
19+ return EXIT_SUCCESS;
20+ }
You can’t perform that action at this time.
0 commit comments