mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +00:00
LibC: Implement a very naive mbtowc()
This just copies the short char into the wide char without any decoding whatsoever. A proper implementation should look at the current LC_CTYPE and implement multi-byte decoding.
This commit is contained in:
@@ -447,9 +447,21 @@ size_t mbstowcs(wchar_t*, const char*, size_t)
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
size_t mbtowc(wchar_t*, const char*, size_t)
|
||||
size_t mbtowc(wchar_t* wch, const char* data, size_t data_size)
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
// FIXME: This needs a real implementation.
|
||||
UNUSED_PARAM(data_size);
|
||||
|
||||
if (wch && data) {
|
||||
*wch = *data;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!wch && data) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wctomb(char*, wchar_t)
|
||||
|
||||
Reference in New Issue
Block a user