mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
11.43.2006 ffcfe5c97aeef4e8d858d4e6545dfebc9e56e4e7
Fix a bug in the ASN1OctetString.stringValue(StringBuilder) method when dealing
with strings containing non-ASCII characters. There were two problems:

- The method did not have a return statment after appending the remainder of
the string once it was determined to be non-ASCII.

- The method did not use the UTF-8 character set when decoding the remainder of
the string once it was determined to be non-ASCII.
1 files modified
15 ■■■■■ changed files
opends/src/server/org/opends/server/protocols/asn1/ASN1OctetString.java 15 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1OctetString.java
@@ -248,7 +248,20 @@
      }
      else
      {
        buffer.append(new String(value, i, (length-i)));
        String s;
        try
        {
          s = new String(value, i, (length-i), "UTF-8");
        }
        catch (Exception e)
        {
          assert debugException(CLASS_NAME, "stringValue", e);
          s = new String(value, i, (length-i));
        }
        buffer.append(s);
        return;
      }
    }
  }