Lots of work on unicode support
This commit is contained in:
@@ -219,18 +219,18 @@ static int socket_poll(struct pollfd *pollvec, int pollcount, int mstimeout, std
|
||||
}
|
||||
|
||||
// Write unicode onto the console.
|
||||
static void console_write(const CodepointString &cps) {
|
||||
std::string utf8 = ReadlineDevice::to_utf8(cps);
|
||||
static void console_write(const std::u32string &cps) {
|
||||
std::string utf8 = drvutil::to_utf8(cps);
|
||||
write(1, utf8.c_str(), utf8.size());
|
||||
}
|
||||
|
||||
static CodepointString console_read() {
|
||||
CodepointString result;
|
||||
static std::u32string console_read() {
|
||||
std::u32string result;
|
||||
char buffer[512];
|
||||
int nread = read(0, buffer, 512);
|
||||
if (nread > 0) {
|
||||
std::string_view s(buffer, nread);
|
||||
result = ReadlineDevice::from_utf8(s, nullptr);
|
||||
result = drvutil::from_utf8(s, nullptr);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user