bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: {# - strange behavior


From: Chet Ramey
Subject: Re: {# - strange behavior
Date: Fri, 20 Feb 2009 22:24:36 -0500
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)

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    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]