also looking at this
fix(android): text going to the JVM is modified UTF-8, and was not being
#168
12 files
+326
-136
| @@ -135,13 +135,13 @@ pub fn readMemory(j: Jni) !MemoryUsage { | ||
| 135 | 135 | /// `CraftBridge` is filtering on a string, and changing it because Zig now |
| 136 | 136 | /// emits the line would break a filter that has nothing to do with this |
| 137 | 137 | /// migration. |
| 138 | pub fn writeLog(j: Jni, message: [*:0]const u8) !void { | |
| 138 | pub fn writeLog(j: Jni, allocator: std.mem.Allocator, message: []const u8) !void { | |
| 139 | 139 | try j.pushLocalFrame(8); |
| 140 | 140 | defer _ = j.popLocalFrame(null); |
| 141 | 141 | |
| 142 | 142 | const cls = try j.findClass("android/util/Log"); |
| 143 | 143 | const tag = try j.newStringUtf("CraftBridge"); |
| 144 | const text = try j.newStringUtf(message); | |
| 144 | const text = try j.newStringUtf8(allocator, message); | |
| 145 | 145 | |
| 146 | 146 | // `Log.d` returns the number of bytes written, which the Kotlin ignores |
| 147 | 147 | // and so does this. Discarding it is not the same as calling a void |