setlocale C.UTF-8 in regex test that depends on UTF-8
[libc-test] / 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
+#include <locale.h>
 #include <regex.h>
 #include "test.h"
 
@@ -9,6 +10,8 @@ int main(void)
        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) {