YolandaMDavis commented on a change in pull request #3576: NIFI-6417
Configurable Jolt Transform Charsets
URL: https://github.com/apache/nifi/pull/3576#discussion_r302990560
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JoltTransformJSON.java
##########
@@ -332,12 +360,15 @@ public void setup(final ProcessContext context) {
} catch (final Exception ex) {
getLogger().error("Unable to setup processor", ex);
}
+
+ inputCharset =
Charset.forName(context.getProperty(INPUT_CHARSET).getValue());
+ outputCharset =
Charset.forName(context.getProperty(OUTPUT_CHARSET).getValue());
}
private JoltTransform createTransform(final ProcessContext context, final
String specString) throws Exception {
final Object specJson;
if (context.getProperty(JOLT_SPEC).isSet() &&
!SORTR.getValue().equals(context.getProperty(JOLT_TRANSFORM).getValue())) {
- specJson = JsonUtils.jsonToObject(specString, DEFAULT_CHARSET);
+ specJson = JsonUtils.jsonToObject(specString, inputCharset.name());
Review comment:
There is a similar call in the advanced UI that may also need to be
addressed for consistency.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services