setlocale C.UTF-8 in regex test that depends on UTF-8
authorSzabolcs Nagy <nsz@port70.net>
Sat, 13 Jun 2015 20:50:53 +0000 (20:50 +0000)
committerSzabolcs Nagy <nsz@port70.net>
Sat, 13 Jun 2015 20:50:53 +0000 (20:50 +0000)
src/regression/regex-escaped-high-byte.c

index 7a29489..70a8d44 100644 (file)
@@ -1,5 +1,6 @@
 // commit 39dfd58417ef642307d90306e1c7e50aaec5a35c 2015-03-20
 // backslash followed by high byte should be parsed as a normal sequence
 // commit 39dfd58417ef642307d90306e1c7e50aaec5a35c 2015-03-20
 // backslash followed by high byte should be parsed as a normal sequence
+#include <locale.h>
 #include <regex.h>
 #include "test.h"
 
 #include <regex.h>
 #include "test.h"
 
@@ -9,6 +10,8 @@ int main(void)
        regex_t r;
        int n;
 
        regex_t r;
        int n;
 
+       setlocale(LC_CTYPE, "C.UTF-8");
+
        // illegal sequence (not U+00FC)
        n = regcomp(&r, "\\\xfc", 0);
        if (n != REG_BADPAT) {
        // illegal sequence (not U+00FC)
        n = regcomp(&r, "\\\xfc", 0);
        if (n != REG_BADPAT) {