{"record":{"id":"2e1ccf2bdf1797c9","repo":"pentaho/pentaho-kettle","slug":"concatfields-error-unsupportedencoding","errorCode":"ConcatFields.Error.UnsupportedEncoding","errorMessage":"ConcatFields.Error.UnsupportedEncoding","messagePattern":"ConcatFields\\.Error\\.UnsupportedEncoding","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/concatfields/ConcatFields.java","lineNumber":217,"sourceCode":"    byte[] targetBinary = ( (ConcatFieldsOutputStream) data.writer ).read();\n    if ( r == null && targetBinary == null ) {\n      return null; // special condition of header/footer/split\n    }\n\n    Object[] outputRowData = prepareOutputRow( r );\n\n    // add target field\n    if ( outputRowData == null ) { // special condition of header/footer/split\n      outputRowData = new Object[ data.outputRowMeta.size() ];\n    }\n    if ( targetBinary != null ) {\n      if ( !data.hasEncoding ) {\n        outputRowData[ data.posTargetField ] = new String( targetBinary );\n      } else { // handle encoding\n        try {\n          outputRowData[ data.posTargetField ] = new String( targetBinary, meta.getEncoding() );\n        } catch ( UnsupportedEncodingException e ) {\n          throw new KettleStepException( BaseMessages.getString( PKG, \"ConcatFields.Error.UnsupportedEncoding\", \"\"\n            + meta.getEncoding() ) );\n        }\n      }\n    } else {\n      outputRowData[ data.posTargetField ] = null;\n    }\n\n    putRow( data.outputRowMeta, outputRowData );\n    return outputRowData;\n  }\n\n  // concat as a fast data dump (no formatting) and call putRow()\n  // this method is only called from a normal line, never from header/footer/split stuff\n  Object[] putRowFastDataDump( Object[] r ) throws KettleStepException {\n\n    Object[] outputRowData = prepareOutputRow( r );\n\n    StringBuilder targetString = new StringBuilder( data.targetFieldLengthFastDataDump ); // use a good capacity","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/concatfields/ConcatFields.java#L199-L235","documentation":"ConcatFields decodes the concatenated binary buffer into a String using the configured character encoding. If meta.getEncoding() names an encoding unsupported by the JVM, the UnsupportedEncodingException is wrapped in this KettleStepException.","triggerScenarios":"putRowFromStream (via processRow or checkAndWriteHeader) runs with data.hasEncoding true and meta.getEncoding() is not a valid charset name for the runtime JVM.","commonSituations":"Typo in encoding string (e.g., 'utf8' vs 'UTF-8' on strict JVMs, 'utf-16x'); transformation authored on a JVM with more charsets installed and run on a minimal JRE.","solutions":["Set a standard encoding such as 'UTF-8' in the step's Content tab.","Check supported encodings with java.nio.charset.Charset.availableCharsets().","Clear the encoding field to let the step use the platform default.","Run on a JRE that includes the required charset provider."],"exampleFix":"// before\nmeta.setEncoding( \"utf8\" );\n// after\nmeta.setEncoding( \"UTF-8\" );","handlingStrategy":"validation","validationCode":"try {\n  java.nio.charset.Charset.forName( meta.getEncoding() );\n} catch ( Exception e ) {\n  throw new IllegalArgumentException( \"Unsupported encoding: \" + meta.getEncoding() );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleStepException e ) {\n  if ( e.getMessage().contains( \"UnsupportedEncoding\" ) ) {\n    logError( \"Set a valid charset (e.g. UTF-8) in the step: \" + e.getMessage() );\n  }\n}","preventionTips":["Use canonical charset names like UTF-8, ISO-8859-1.","Validate encodings with Charset.forName() before deploying.","Test transformations on the target JVM, not only the dev machine."],"tags":["kettle","pdi","encoding","charset"],"backgroundTag":"invalid-config-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}