Re: problem with cjkcodecs on Mandrake linux +++
From: Anthony Liu (antonyliu2002_at_yahoo.com)
Date: 03/17/04
- Next message: QMartin_v=2E_L=F6wis=22?=: "Re: problem with cjkcodecs on Mandrake linux"
- Previous message: Dietrich Epp: "Re: Inconsistency in Python's Comparisons"
- Next in thread: Skip Montanaro: "Re: problem with cjkcodecs on Mandrake linux +++"
- Maybe reply: Skip Montanaro: "Re: problem with cjkcodecs on Mandrake linux +++"
- Maybe reply: Anthony Liu: "Re: problem with cjkcodecs on Mandrake linux +++"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 16 Mar 2004 21:23:54 -0800 (PST) To: py <python-list@python.org>
Nobody knows what the problem is?
It seems that the cjkcodecs package is correctly
installed by the super user.
At this point of time, cjkcodecs is only installed on
one Mandrake host in the lab. And on this host, it is
ok to do
s = 'abc'
unicode(s, 'gbk')
print s # prints 'abc'
On the other Mandrake host, where cjkcodecs is not
installed, the script above won't work, python
complains that it does not know what 'gbk' is.
But then why can't I encode a Chinese string on the
host which has cjkcodecs?
--- Anthony Liu <antonyliu2002@yahoo.com> wrote:
> But I am using gbcxterm, which displays Chinese very
> well, plus, I think I can also input Chinese using
> this terminal. Then why do I still have this
> problem?
>
> --- Erik Max Francis <max@alcyone.com> wrote:
> > Anthony Liu wrote:
> >
> > > I get the following error message.
> > >
> > > [antony@ancho tmp]$ python snake.py
> > > Traceback (most recent call last):
> > > File "snake.py", line 6, in ?
> > > print a
> > > UnicodeEncodeError: 'latin-1' codec can't encode
> > > characters in position 0-1: ordinal not in
> > range(256)
> > > [antony@ancho tmp]$
> > >
> > > What is the problem please?
> >
> > The problem is the default encoding is Latin-1,
> > presumably because
> > that's the only thing your xterm/virtual console
> > understands. So Python
> > is rightly complaining that it can't print the
> > Chinese characters for
> > you.
> >
> > --
> > __ Erik Max Francis && max@alcyone.com &&
> > http://www.alcyone.com/max/
> > / \ San Jose, CA, USA && 37 20 N 121 53 W &&
> > &tSftDotIotE
> > \__/ In this world, nothing is certain but death
> and
> > taxes.
> > -- Benjamin Franklin
> > --
> >
> http://mail.python.org/mailman/listinfo/python-list
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - More reliable, more storage, less spam
> http://mail.yahoo.com
>
> --
> http://mail.python.org/mailman/listinfo/python-list
__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com
- Next message: QMartin_v=2E_L=F6wis=22?=: "Re: problem with cjkcodecs on Mandrake linux"
- Previous message: Dietrich Epp: "Re: Inconsistency in Python's Comparisons"
- Next in thread: Skip Montanaro: "Re: problem with cjkcodecs on Mandrake linux +++"
- Maybe reply: Skip Montanaro: "Re: problem with cjkcodecs on Mandrake linux +++"
- Maybe reply: Anthony Liu: "Re: problem with cjkcodecs on Mandrake linux +++"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]