Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

word[-1]= breaks on multibyte?



% word=abcã
% echo $word
abcã
% echo $word[-1]
ã

so far so good, but
% word[-1]=
% echo $word
abcÂ
% word=abcã
% word[-1]=a
% echo $word
abcaÂ
% word=abcã
% word[-2]=
% echo $word
abã

It seems like it finds the correct index, but the actual assignment
goes wrong. Only for negative indices though. Which is weird, I would
have thought the actual assignment was the same once it found the
spot.
% word=abãã
% word[-2]=c
% echo $word
abcÂã
% word=abãã
% word[-1]=c
% echo $word
abãcÂ
% word=abãã
% word[3]=c
% echo $word
abcã
% word=abãã
% word[4]=d
% echo $word
abãd


-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author