1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:57:35 +00:00

LibC: Implement btowc()

This commit is contained in:
Tim Schumacher 2021-06-05 02:23:53 +02:00 committed by Andreas Kling
parent e4fa9c917e
commit 405f3d0aa3

View file

@ -154,10 +154,18 @@ long long wcstoll(const wchar_t*, wchar_t**, int)
TODO();
}
wint_t btowc(int)
wint_t btowc(int c)
{
dbgln("FIXME: Implement btowc()");
TODO();
if (c == EOF) {
return WEOF;
}
// Multi-byte sequences in UTF-8 have their highest bit set
if (c & (1 << 7)) {
return WEOF;
}
return c;
}
size_t mbrtowc(wchar_t*, const char*, size_t, mbstate_t*)