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

Euro sign convertion fails on solaris

XMLWordPrintable

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

      FULL PRODUCT VERSION :
      java version "1.5.0_08"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
      Java HotSpot(TM) Server VM (build 1.5.0_08-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      SunOS dolly 5.10 Generic_118822-30 sun4u sparc SUNW,Ultra-60

      A DESCRIPTION OF THE PROBLEM :
      The String constructor converts the euro sign (0xa4) to ? (0x3f) with charset ISO-8859-15 on solaris.
      It works on the windows plattform.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

      byte[] bytes={0x3f,0x20,-92,0x20,0x31}; // -92 is the euro sign (0xa4)

      String str= new String(bytes,"ISO8859_15");



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      str="? € 1"

      str.getBytes()={0x3f,0x20,0x20ac,0x20,0x31}
      ACTUAL -
      str="? ? 1"

      str.getBytes()={0x3f,0x20,0x3f,0x20,0x31}

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      byte[] bytes={0x3f,0x20,-92,0x20,0x31}; // -92 is the euro sign (0xa4)

      String str= new String(bytes,"ISO8859_15");
      ---------- END SOURCE ----------

            martin Martin Buchholz
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: