python + ncurses:我无法显示重音符号 [英] python+ncurses: I can't display accents

查看:72
本文介绍了python + ncurses:我无法显示重音符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



您好。


我正在尝试显示法语字符(è - 那个'坟墓 - 或者à - <在python 2.5中使用ncurses包装器,我不能。

我的语言环境设置正确(fr_FR.iso885915),我的终端(rxvt-unicode)

能够显示那些字符。


我缺少什么?


谢谢。


-

Fabrice DELENTE

解决方案

2007-01 -26,Fabrice DELENTE< fd ****** @ mail.cpod.frwrote:


我正在尝试显示法语字符(è - 在python 2.5中,这是'坟墓 -

或à - agrave),使用ncurses包装,

来了,我不能。我的语言环境设置正确

(fr_FR.iso885915),我的终端(rxvt-unicode)能够显示这些字符。
显示这些字符。



你试过什么?


-

Neil Cerutti


-

通过的免费Usenet帐户发布http://www.teranews.com


你有什么尝试?


我''试过


stdscr.addstr(0,0,aé?où)





stdscr.addstr(0,0,le?on)


ASCII字符显示正确,但重音字符不是,所以我请参阅

''ao''或'leon''在屏幕上。


我显示的术语是8位,所以问题是在

ncurses方面,或在python方面。


我有


#!/ usr / local / bin / python

#coding:iso8859-15

在我的python文件的顶部。


-

Fabrice DELENTE


< blockquote>在2007-01-26,Fabrice DELENTE< fd ****** @ mail.cpod.frwrote:


>你有什么尝试?



我试过了


stdscr.addstr(0,0,"aé?où")





stdscr.addstr(0,0," le?on")


ASCII字符显示正确,但重音字符

不,所以我在屏幕上看到''ao''或''leon''。


我显示的术语是8位,所以问题是在ncurses一侧或者在python一侧是



尝试这种情况会发生什么?


stdscr.addstr(0,0,u" le?on"。编码(''iso8859-15''))


我真的没想到它会起作用,但如果有的话,那就是

它。 Curses只支持ASCII和一些特殊符号代码

由curses定义。


我有


#!/ usr / local / bin / python

#coding:iso8859-15



一定要写下你的非ASCII字符串作为unicode文字,然后

然后在显示或存储它们之前对它们进行编码

某处。


-

Neil Cerutti


-

通过 http://www.teranews.com



Hello.

I''m trying to display french characters (è -- that''s e grave -- or à --
agrave) in python 2.5, with the ncurses wrapper that comes it, and I can''t.
My locale is set correctly (fr_FR.iso885915), and my terminal (rxvt-unicode)
is able to display those chars.

What am I missing?

Thanks.

--
Fabrice DELENTE

解决方案

On 2007-01-26, Fabrice DELENTE <fd******@mail.cpod.frwrote:

I''m trying to display french characters (è -- that''s e grave --
or à -- agrave) in python 2.5, with the ncurses wrapper that
comes it, and I can''t. My locale is set correctly
(fr_FR.iso885915), and my terminal (rxvt-unicode) is able to
display those chars.

What have you tried?

--
Neil Cerutti

--
Posted via a free Usenet account from http://www.teranews.com


What have you tried?

I''ve tried

stdscr.addstr(0,0,"aé?où")

or

stdscr.addstr(0,0,"le?on")

The ASCII chars show correctly, but the accented characters don''t, so I see
''ao'' or ''leon'' on the screen.

The term in which I display is 8-bit-able, so the problem is either on
ncurses side, or on python side.

I have

#!/usr/local/bin/python
#coding: iso8859-15

at the top of my python file.

--
Fabrice DELENTE


On 2007-01-26, Fabrice DELENTE <fd******@mail.cpod.frwrote:

>What have you tried?


I''ve tried

stdscr.addstr(0,0,"aé?où")

or

stdscr.addstr(0,0,"le?on")

The ASCII chars show correctly, but the accented characters
don''t, so I see ''ao'' or ''leon'' on the screen.

The term in which I display is 8-bit-able, so the problem is
either on ncurses side, or on python side.

What happens when you try this?

stdscr.addstr(0,0, u"le?on".encode(''iso8859-15''))

I don''t really expect it to work, but if anything will, that is
it. Curses supports only ASCII and a some special symbol codes
defined by curses.

I have

#!/usr/local/bin/python
#coding: iso8859-15

Be sure to write your non-ASCII strings as unicode literals, and
then encode them just before displaying or storing them
somewhere.

--
Neil Cerutti

--
Posted via a free Usenet account from http://www.teranews.com


这篇关于python + ncurses:我无法显示重音符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆