ReviewOS

also looking at this

craft-native/craft

fix(android): text going to the JVM is modified UTF-8, and was not being

#168
Merged chris wants to merge fix/android-modified-utf8 into main
12 files +326 -136
packages/zig/src/bridge_android_calendar.zigmodified+4-7
Changes to packages/zig/src/bridge_android_calendar.zig
@@ -612,15 +612,12 @@ fn putString(
612612 try j.pushLocalFrame(4);
613613 defer _ = j.popLocalFrame(null);
614614
615 // `NewStringUTF` needs a NUL terminator, and a title is arbitrary page
616 // text — so it is copied rather than pointed at.
617 const terminated = try allocator.allocSentinel(u8, text.len, 0);
618 defer allocator.free(terminated);
619 @memcpy(terminated, text);
620
615 // A title is arbitrary page text, so it goes through the re-encoder: a
616 // NUL would end the string early and an emoji is a surrogate pair to the
617 // JVM.
621618 try j.callVoidMethodA(values, put, &.{
622619 .{ .l = try j.newStringUtf(column) },
623 .{ .l = try j.newStringUtf(terminated.ptr) },
620 .{ .l = try j.newStringUtf8(allocator, text) },
624621 });
625622}
626623