468,283 Members | 1,526 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

Help: printing Unicode characters during telnet session

Hi,

I have a multiuser script, that I would like to convert to Python.
The users open simultaneous telnet -sessions from win2000 to
an unix machine and possibly edit unicode textfiles. Currently users
use vi and more, but I would like to add unicode support to the script.
I would not like to force them to open X-sessions in order to show
Multilanguage characters.

Should I create python shell or is there any other way ?
Python's "print" does not seem to work for all characters :(

Do not bother to point me to the existing FAQ and tutorials, because
they do not provide solutions for this problem (searched whole day
allready).

-pekka-

Jul 18 '05 #1
4 6498

"Pekka Niiranen" <pe************@wlanmail.com> schrieb im Newsbeitrag
news:bd**********@news1.songnet.fi...
Hi,

I have a multiuser script, that I would like to convert to Python.
The users open simultaneous telnet -sessions from win2000 to
an unix machine and possibly edit unicode textfiles. Currently users
use vi and more, but I would like to add unicode support to the script.
I would not like to force them to open X-sessions in order to show
Multilanguage characters.

Should I create python shell or is there any other way ?
Python's "print" does not seem to work for all characters :(
What do you mean? For which characters doesn't the print statement work?

Vincent Wehren
Do not bother to point me to the existing FAQ and tutorials, because
they do not provide solutions for this problem (searched whole day
allready).

-pekka-

Jul 18 '05 #2
Pekka Niiranen wrote:
Should I create python shell or is there any other way ?


If, by "shell", you mean the Windows terminal window:

This can only display a limited number of characters. This is
not inherently a limitation of python, but of the terminal
window - this system component uses a certain font, and that
font only supports so many characters.

To get support for more characters, you need to do a number of
things:
a) use a console font with more characters, e.g. Lucida Console,
b) use a console code page that has all the characters that you
want to display.
c) tell the editor on the other end to convert the text file,
for display, to the code page that your terminal supports

There is nothing Python could do for you to improve this
situation. You might consider using a different terminal
emulation, though.

Regards,
Martin

Jul 18 '05 #3
Pekka Niiranen wrote:
Python's "print" does not seem to work for all characters :(
maybe you should define "does not seem to work", so we don't
have to guess...
Do not bother to point me to the existing FAQ and tutorials, because
they do not provide solutions for this problem (searched whole day
allready).


do you get "ASCII encoding error: ordinal not in range(128)"?

If so, Google returns 641 hits for that error message. The third hit is
a "Python Unicode Tutorial" which shows you how to use the "encode"
method to turn unicode strings into encoded 8-bit strings, suitable for
printing...

</F>


Jul 18 '05 #4
Pekka Niiranen <pe************@wlanmail.com> writes:
How about adding better font to Python distribution ?


-1. Dealing with operating system fonts is not our business.

Regards,
Martin
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Rune Hansen | last post: by
11 posts views Thread by Marian Aldenhövel | last post: by
3 posts views Thread by Bobo | last post: by
10 posts views Thread by John Sidney-Woollett | last post: by
1 post views Thread by Rahul | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.