Lots of work on unicode support
This commit is contained in:
@@ -206,7 +206,7 @@ class Driver {
|
||||
if (ndata > DRV_SHORTSTRING_SIZE) ndata = DRV_SHORTSTRING_SIZE;
|
||||
std::string_view src(data, ndata);
|
||||
int consumed;
|
||||
CodepointString cps = ReadlineDevice::from_utf8(src, &consumed);
|
||||
std::u32string cps = drvutil::from_utf8(src, &consumed);
|
||||
readline_device_.print(cps);
|
||||
engw.play_sent_outgoing(&engw, 0, consumed);
|
||||
}
|
||||
@@ -217,16 +217,16 @@ class Driver {
|
||||
uint32_t promptlen;
|
||||
const char *promptdata;
|
||||
engw.get_console_prompt(&engw, &promptlen, &promptdata);
|
||||
CodepointString prompt = ReadlineDevice::from_utf8(std::string_view(promptdata, promptlen), nullptr);
|
||||
std::u32string prompt = drvutil::from_utf8(std::string_view(promptdata, promptlen), nullptr);
|
||||
readline_device_.set_prompt(prompt);
|
||||
while (true) {
|
||||
CodepointString cps = console_read();
|
||||
std::u32string cps = console_read();
|
||||
if (cps.size() == 0) break;
|
||||
read_console_recently_ = true;
|
||||
for (char32_t c : cps) {
|
||||
CodepointString line = readline_device_.putcode(c);
|
||||
std::u32string line = readline_device_.putcode(c);
|
||||
if (!line.empty()) {
|
||||
std::string utf8 = ReadlineDevice::to_utf8(line);
|
||||
std::string utf8 = drvutil::to_utf8(line);
|
||||
engw.play_recv_incoming(&engw, 0, utf8.size(), utf8.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user