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

ludovicp
31.31.2010 ebe885923408e8576b45bee4fe5f05e06c313fb9
Fix for issue #4232: This enables the LDIFReader to skip the BOM in LDIF files.
1 files modified
9 ■■■■ changed files
opends/src/server/org/opends/server/util/LDIFReader.java 9 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/LDIFReader.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 */
package org.opends.server.util;
import org.opends.messages.Message;
@@ -815,6 +815,13 @@
        {
          lastEntryLineNumber = lineNumber;
        }
        if(((byte)line.charAt(0) == (byte)0xEF) &&
          ((byte)line.charAt(1) == (byte)0xBB) &&
          ((byte)line.charAt(2) == (byte)0xBF))
        {
          // This is a UTF-8 BOM that Java doesn't skip. We will skip it here.
          line = line.substring(3, line.length());
        }
        lines.add(new StringBuilder(line));
        lastLine++;
      }