Help: printing Unicode characters during telnet session

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pekka Niiranen

    #1

    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

    #2
    Re: printing Unicode characters during telnet session


    "Pekka Niiranen" <pekka.niiranen @wlanmail.com> schrieb im Newsbeitrag
    news:bda6re$uts $1@news1.songne t.fi...[color=blue]
    > 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 :([/color]

    What do you mean? For which characters doesn't the print statement work?

    Vincent Wehren[color=blue]
    >
    > 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-
    >[/color]


    Comment

    • Martin v. Löwis

      #3
      Re: Help: printing Unicode characters during telnet session

      Pekka Niiranen wrote:
      [color=blue]
      > Should I create python shell or is there any other way ?[/color]

      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

      Comment

      • Fredrik Lundh

        #4
        Re: printing Unicode characters during telnet session

        Pekka Niiranen wrote:
        [color=blue]
        > Python's "print" does not seem to work for all characters :([/color]

        maybe you should define "does not seem to work", so we don't
        have to guess...
        [color=blue]
        > 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).[/color]

        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>




        Comment

        • Martin v. Löwis

          #5
          Re: Got it: printing Unicode characters during telnet session

          Pekka Niiranen <pekka.niiranen @wlanmail.com> writes:
          [color=blue]
          > How about adding better font to Python distribution ?[/color]

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

          Regards,
          Martin

          Comment

          Working...