Help: printing Unicode characters during telnet session

P

Pekka Niiranen

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-
 
V

vincent wehren

Pekka Niiranen said:
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
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Pekka said:
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
 
F

Fredrik Lundh

Pekka said:
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>
 
M

Martin v. =?iso-8859-15?q?L=F6wis?=

Pekka Niiranen said:
How about adding better font to Python distribution ?

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

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top