Antonio Macchi wrote: > > $ a=$'\xd9\xbf' > > $ echo ${#a} > 1 > > $ a2=${a:0:1} > > $ echo ${#a2} > 1 > > > > > this two characters are "j" and "k" graphical characters in linux > terminal/console > > I need to extract only one... but apparently I can't.
Those two bytes happen to compose a valid multibyte character, and you're using a locale that supports them. If you want to treat the bytes individually, make your locale "C". Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/