2 ms·
> How would you fix this? Possibly by copying the input array to a local array as the first step? Upon encountering a non-Latin1 char, convert the existing lat
by masklinn 3y ago
> How would you fix this? Possibly by copying the input array to a local array as the first step?
Upon encountering a non-Latin1 char, convert the existing latin1 array to an utf16 one, append the char (converted), then resume iteration in utf16 copy mode.
This way you know the char which made you bail out on Latin1 is part of the output.