Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2570#discussion_r176437638
--- Diff:
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java
---
@@ -1100,4 +1189,16 @@ public static boolean isScalarValue(final DataType
dataType, final Object value)
return true;
}
+
+ public static Charset getCharset(String charsetName) {
+ if(charsetName == null) {
+ return StandardCharsets.UTF_8;
+ } else {
+ try {
+ return Charset.forName(charsetName);
+ } catch(Exception e) {
--- End diff --
If given an invalid character set, I think I would prefer to just throw the
Exception. If there is a typo somewhere, this can lead to some very unexpected
results that are difficult to track down.
---