Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4366531

Control characters read and displayed as exotic Unicode letters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-libs



      Name: skT45625 Date: 08/28/2000


      Java Hotspot Client VM (build 1.3.0beta-b07, mixed mode)

      Certain control characters are interpreted mistakenly by JVM. In writing a
      telnet-based server, it is essential to be able to use these characters as
      they're part of the protcol. These characters are:
      - IAC (interpret as command character, ASCII value 255) which is interpreted
      with the Java as an exotic Syriac character with the unicode value of 0729
      instead of the correct unicode value of 009B (i think)
      - EL (erase line, ASCII value 248) is interpreted as a greek letter with the
      unicode value 0345
      - GA (go ahead character, ASCII value 249) is interpreted as character with a
      unicode value of 367

      There are most probobly many more, but these are tested. Note that the output is
      consistent - the exact same erronous values are produced at any given time

      Here's a code snippet that produces the incorrect values:

      BufferedReader reader = new BufferedReader(
      new InputStreamReader(socket.getInputStream()));

      void doRead() throws Exception
      {
      int readOne;
      readOne = reader.read();
      // And now here's the erronous output
      System.out.println("Char: " + (char) readOne + " / value: " +
      readOne);
      }

      Please be advised that i'm certain that the characters sent to the stream for
      reading are the correct values, since i used a standard telnet application that
      comes with any Unix system to send them. Besides on a server that uses the exact
      same protocol like mine (but is written in C) the sent characters were correctly
      interpreted.
      (Review ID: 108987)
      ======================================================================

            ilittlesunw Ian Little (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: