writeone and formatraw's rune arm did `buf[0] = r: u8; putbytes(...,1)`, emitting only the low byte — invalid UTF-8 for any rune > 0x7F, with a success return. rawlen's rune arm hardcoded 1, desyncing width-padding for multibyte runes. Route both write arms through utf8.encoderune and rawlen through utf8.runesz (ref/hare/fmt/print.ha:84). Uses the current in-tree encoderune(out: []u8, r) caller-buffer signature; report-#168's signature realignment is a separate item, not folded here. fmttest gains fprintrune (1/2/3/4-byte runes) + fprintf_rune_width (multibyte pad).
28 KiB
28 KiB