count utf8 codepoints for CData getLength

This commit is contained in:
Muki Kiboigo
2026-01-06 21:29:15 -08:00
parent dcde19de3c
commit f9fa5be324

View File

@@ -147,7 +147,7 @@ pub fn format(self: *const CData, writer: *std.io.Writer) !void {
} }
pub fn getLength(self: *const CData) usize { pub fn getLength(self: *const CData) usize {
return self._data.len; return std.unicode.utf8CountCodepoints(self._data) catch self._data.len;
} }
pub fn isEqualNode(self: *const CData, other: *const CData) bool { pub fn isEqualNode(self: *const CData, other: *const CData) bool {