Skip to content

Commit 91ba8ce

Browse files
committed
unzip: explicitly set en_US.UTF-8 locale in test_I.c
1 parent eb7939b commit 91ba8ce

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

unzip/test/test_I.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,25 @@
2525
*/
2626
#include "test.h"
2727

28+
#ifdef HAVE_LOCALE_H
29+
#include <locale.h>
30+
#endif
31+
2832
/* Test I arg - file name encoding */
2933
DEFINE_TEST(test_I)
3034
{
3135
const char *reffile = "test_I.zip";
3236
int r;
3337

38+
#if HAVE_SETLOCALE
39+
if (NULL == setlocale(LC_ALL, "en_US.UTF-8")) {
40+
skipping("en_US.UTF-8 locale not available on this system.");
41+
return;
42+
}
43+
#else
44+
skipping("setlocale() not available on this system.");
45+
#endif
46+
3447
extract_reference_file(reffile);
3548
r = systemf("%s -I UTF-8 %s >test.out 2>test.err", testprog, reffile);
3649
assertEqualInt(0, r);

0 commit comments

Comments
 (0)