Re: Bash and Unicode

2012-09-21 Thread Andreas Schwab
Your keyboard input apparently uses UTF-8 encoding, so the single
character ó is represented by two bytes with the values 195 and 179.
This has nothing at all to do with the shell, most likely your locale
settings are messed up.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



Re: Bash and Unicode

2012-09-21 Thread Jakub Jankiewicz

On Fri, 21 Sep 2012 09:11:45 +0200
Andreas Schwab  wrote:

> Your keyboard input apparently uses UTF-8 encoding, so the single
> character ó is represented by two bytes with the values 195 and 179.
> This has nothing at all to do with the shell, most likely your locale
> settings are messed up.
> 
> Andreas.
> 

Does it mean that, Unicode work normal with bash and it display one
character when everything is right? Does this code work on different
systems:

python -c 'print "ó"'

I could report it to Ubuntu, but maybe it's something larger or
smaller. Maybe it's a bug and no one nice that or just misconfiguration.

In locale I have pl_PL.UTF-8 which I didn't change and everything work
except bash.

I have the same issue on Red Hat 4.4.6-3 run via ssh, but maybe it's
with how keyboard is handled (python run inside ssh work the same but
not from command line).

How bash handle input? Using readline right? So next thing I should
check is to look there, right?

Do you know what kind of steps and different libraries/code are
executed from time when user hit the key to the time when character is
process with bash? So I can track back and check each step.

Linux Driver, Readline, bash - are there more?

--
Jakub Jankiewicz, Web Developer
http://jcubic.pl


signature.asc
Description: PGP signature


Re: Bash and Unicode

2012-09-21 Thread Andreas Schwab
Jakub Jankiewicz  writes:

> In locale I have pl_PL.UTF-8 which I didn't change and everything work
> except bash.

Then it's a bug in python if it cannot properly parse its command line.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



Re: Bash and Unicode

2012-09-21 Thread Andreas Schwab
Did you read ?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



Re: Bash and Unicode

2012-09-21 Thread Jakub Jankiewicz


On Fri, 21 Sep 2012 11:46:26 +0200
Andreas Schwab  wrote:

> Did you read ?
> 
> Andreas.
> 

I forget about it, this work:

python -c '# coding: utf-8
print ord(u"ó")'

Probably interactive python have enabled it by default. I try to test
sed if I can swap one character and it's not by a chance handled as 2
characters

echo -n ó | sed -e 's/[ó]\{1\}/_/'

and it's not. The output is one "_"

So thanks with your help and sorry for trouble.

--
Jakub Jankiewicz, Web Developer
http://jcubic.pl


signature.asc
Description: PGP signature


Re: Bash dumps stack after writing to /etc

2012-09-21 Thread Eric Blake
On 09/21/2012 06:24 AM, Axel Svensson wrote:
> Machine: i686
> OS: cygwin on Windows 7 Professional SP1
> Compiler: gcc-4
> Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686'
> -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc'
> -DLOCALEDIR='/usr/$
> uname output: CYGWIN_NT-6.1 Machine-name 1.7.16(0.262/5/3) 2012-07-20 22:55
> i686 Cygwin
> Machine Type: i686-pc-cygwin

Have you reproduced this on non-cygwin platforms, or should you be
reporting this to the cygwin folks as a bug in their port?

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature