* [musl] regexec(): not matching ASCII in latin1/"bad utf8" text while on a UTF8 locale
@ 2024-05-08 23:42 Oliver Webb
0 siblings, 0 replies; only message in thread
From: Oliver Webb @ 2024-05-08 23:42 UTC (permalink / raw)
To: musl
The boiled down code example code for this is:
#include <regex.h>
#include <stdio.h>
#include <locale.h>
int main() {
uselocale(newlocale(LC_CTYPE_MASK, "C.UTF-8", 0));
regex_t r; regcomp(&r, "\n", 0);
printf("%d\n", regexec(&r, "\xb5\n", 0, 0, 0) == REG_NOMATCH);
}
(\xb5 can be substituted for any latin1 or improper utf8)
Which on glibc will print 0, on musl it will print 1
Thanks,
- Oliver Webb <aquahobbyist@proton.me>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-08 23:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-08 23:42 [musl] regexec(): not matching ASCII in latin1/"bad utf8" text while on a UTF8 locale Oliver Webb
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).