Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Help: printing Unicode characters during telnet session (http://www.velocityreviews.com/forums/t318807-help-printing-unicode-characters-during-telnet-session.html)

Pekka Niiranen 06-24-2003 06:52 PM

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-


vincent wehren 06-24-2003 07:42 PM

Re: printing Unicode characters during telnet session
 

"Pekka Niiranen" <pekka.niiranen@wlanmail.com> schrieb im Newsbeitrag
news:bda6re$uts$1@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-
>




=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= 06-24-2003 07:46 PM

Re: Help: printing Unicode characters during telnet session
 
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


Fredrik Lundh 06-24-2003 07:52 PM

Re: printing Unicode characters during telnet session
 
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>





Martin v. =?iso-8859-15?q?L=F6wis?= 06-25-2003 06:13 PM

Re: Got it: printing Unicode characters during telnet session
 
Pekka Niiranen <pekka.niiranen@wlanmail.com> writes:

> How about adding better font to Python distribution ?


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

Regards,
Martin


All times are GMT. The time now is 05:27 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.