It was using the internal byte count instead of the number of charac-
ters. The iatter is documented. The former is useless, even for C
code calling this, as later arguments could cause the current buffer
to be upgraded to utf8, throwing off any offsets returned.
}
}
else
- sv_setuv_mg(argsv, (UV)i);
+ sv_setuv_mg(argsv, has_utf8 ? (UV)sv_len_utf8(sv) : (UV)i);
continue; /* not "break" */
/* UNKNOWN */
>%m< >''< >%m INVALID<
>%s< >sprintf('%%n%n %d', $n, $n)< >%n 2< >Slight sneakiness to test %n<
>%s< >$n="abc"; sprintf(' %n%s', substr($n,1,1), $n)< > a1c< >%n w/magic<
+>%s< >sprintf('%s%n', chr(256)x5, $n),$n< >5< >Unicode %n<
>%o< >2**32-1< >37777777777<
>%+o< >2**32-1< >37777777777<
>%#o< >2**32-1< >037777777777<