window charCallback accepts doesn't assume ASCII, accepts any Unicode CP

This commit is contained in:
Mitchell Hashimoto
2023-02-19 12:02:41 -08:00
parent fbcd5bc0c8
commit 7fa02cae95

View File

@ -741,11 +741,11 @@ pub fn charCallback(self: *Window, codepoint: u21) !void {
// Ask our IO thread to write the data // Ask our IO thread to write the data
var data: termio.Message.WriteReq.Small.Array = undefined; var data: termio.Message.WriteReq.Small.Array = undefined;
data[0] = @intCast(u8, codepoint); const len = try std.unicode.utf8Encode(codepoint, &data);
_ = self.io_thread.mailbox.push(.{ _ = self.io_thread.mailbox.push(.{
.write_small = .{ .write_small = .{
.data = data, .data = data,
.len = 1, .len = len,
}, },
}, .{ .forever = {} }); }, .{ .forever = {} });