Summary: The models for InputStreamReader and OutputStreamWriter are taking into consideration the charset passed as parameter in order to follow the exception branch when the charset is not valid. However, the previsous models were only considering encoding literals with uppercase letters. This diff adds the lowercase encoding names to the list. Closes https://github.com/facebook/infer/issues/127master
parent
ef27abcc8f
commit
392cd0dee0
@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2015-Present Facebook. All rights reserved.
|
||||
|
||||
package com.facebook.infer.models;
|
||||
|
||||
public class InferUtils {
|
||||
|
||||
public static boolean isValidCharset(String charsetName) {
|
||||
return charsetName == "UTF8"
|
||||
|| charsetName == "utf8"
|
||||
|| charsetName == "UTF-8"
|
||||
|| charsetName == "utf-8"
|
||||
|| charsetName == "US-ASCII"
|
||||
|| charsetName == "us-ascii"
|
||||
|| charsetName == "ISO-8859-1"
|
||||
|| charsetName == "iso-8859-1"
|
||||
|| charsetName == "UTF-16BE"
|
||||
|| charsetName == "utf-16be"
|
||||
|| charsetName == "UTF-16LE"
|
||||
|| charsetName == "utf-16le"
|
||||
|| charsetName == "UTF-16"
|
||||
|| charsetName == "utf-16";
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue