Rename some unicode functions and document better

This commit is contained in:
2023-05-30 23:35:54 -04:00
parent 54125c9c8c
commit b98bf33724
4 changed files with 15 additions and 9 deletions

View File

@@ -221,7 +221,7 @@ static int socket_poll(struct pollfd *pollvec, int pollcount, int mstimeout, std
// Write unicode onto the console.
static void console_write(const std::u32string &cps) {
std::string utf8 = drvutil::to_utf8(cps);
std::string utf8 = drvutil::utf32_to_utf8(cps);
write(1, utf8.c_str(), utf8.size());
}
@@ -231,7 +231,7 @@ static std::u32string console_read() {
int nread = read(0, buffer, 512);
if (nread > 0) {
std::string_view s(buffer, nread);
result = drvutil::from_utf8(s, nullptr);
result = drvutil::utf8_to_utf32(s, nullptr);
}
return result;
}