fhueske commented on a change in pull request #6823: [FLINK-10134] UTF-16 support for TextInputFormat bug refixed URL: https://github.com/apache/flink/pull/6823#discussion_r225532403
########## File path: flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java ########## @@ -504,16 +533,119 @@ private void initBuffers() { this.end = false; } + /** + * Set file bom encoding. + * + * @param split + */ + private void setBomFileCharset(FileInputSplit split) { + try { + String filePath = split.getPath().toString(); + if (this.fileBomCharsetMap.containsKey(filePath)) { + this.bomCharset = this.fileBomCharsetMap.get(filePath); + } else { + byte[] checkBytes = new byte[]{(byte) 0x00, (byte) 0xFE, (byte) 0xFF, (byte) 0xEF, (byte) 0xBB, (byte) 0xBF}; Review comment: This can be a static field of the class. Rename to `bomBytes` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services