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

sin
30.26.2009 fada6080f86ea8cbc8369e3263b97f086460cb29
Issue#3910:Base64 encoding doesn't work with UTF-8 chars
1 files modified
13 ■■■■ changed files
opends/src/server/org/opends/server/util/Base64.java 13 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/Base64.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.util;
@@ -37,6 +37,7 @@
import java.io.FileWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.text.ParseException;
import java.util.ArrayList;
@@ -607,7 +608,15 @@
      byte[] dataToEncode = null;
      if (rawData.isPresent())
      {
        dataToEncode = rawData.getValue().getBytes();
        try
        {
          dataToEncode = rawData.getValue().getBytes("UTF-8");
        }
        catch(UnsupportedEncodingException ex)
        {
          System.err.println(ERR_UNEXPECTED.get(ex.toString()).toString());
          System.exit(1);
        }
      }
      else
      {