bug-bash
[Top][All Lists]
Advanced

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

Re: Bash and Unicode


From: Jakub Jankiewicz
Subject: Re: Bash and Unicode
Date: Fri, 21 Sep 2012 02:41:32 +0200


On Thu, 20 Sep 2012 19:23:02 -0400
DJ Mills <address@hidden> wrote:

> On Thu, Sep 20, 2012 at 6:00 PM, Jakub Jankiewicz <address@hidden>
> wrote:
> > Hi,
> >
> > I don't know where to ask this or report a bug about it.
> >
> > I find an issue with Unicode characters (polish) using figlet
> >
> > $ figlet ó
> >
> >   /\/|____
> >  |/\/|__ /
> >   /_\ |_ \
> >  / _ \___/
> > /_/ \_\
> >
> > ó is 243, I can call ord(u'ó') form python but not from bash
> >
> > $ python -c 'print ord(u"ó")'
> > Traceback (most recent call last):
> >   File "<string>", line 1, in <module>
> > TypeError: ord() expected a character, but string of length 2 found
> >
> > and it display 2 characters I found that they are:
> >
> > 195+179
> >
> > and the reason for this is I got:
> >
> > echo -n ó | python -c 'import sys;
> > for c in sys.stdin.read():
> >     print ord(c)'
> > 195
> > 179
> >
> > in my system. I thought that it's something with bash, so I try to
> > call exec function from C (I think it don't use shell).
> >
> > #include <unistd.h>
> >
> > void main() {
> >     execl("/usr/bin/figlet-figlet", "", "ó", NULL);
> > }
> >
> > and got the same result. What's wrong? Anybody know how to fix it?
> > Where should I report this. Or maybe I have something wrong with my
> > system.
> >
> > I'm using Ubuntu 11.10 with XFce.
> >
> >
> > --
> > Jakub Jankiewicz, Web Developer
> > http://jcubic.pl
> 
> 
> This would be an issue with the figlet program, which has nothing to
> do with bash.
> 
> The man page (http://linux.die.net/man/6/figlet) gives the email
> address address@hidden
> 

I wanted to send this to that list first, but then I found that I
can't run this from bash.

$ python -c 'print ord(u"ó")'

but can from python

$ python
>>> print ord(u"ó")

How come python got 2 characters in first case and one in the second?

What is the difference between a way how bash handle this one letter
and python? Maybe it's something with readline. Because python do the
same what figlet does, handle characters that are passed to him. Maybe
python interpreter do something to fix the issue that's in whole
system, maybe it's because python use different library or don't use
readline. Or maybe it's just configuration issue with my Ubuntu
installation or in Ubuntu itself.

it's definitely not related to figlet but I'm not sure if it's bash
related either. I'm asking it here because you know how bash work and
you can point me in right direction and figlet is not the right one.

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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