{"record":{"id":"c0c1297356abc6cc","repo":"pentaho/pentaho-kettle","slug":"unsupported-character-encoding","errorCode":null,"errorMessage":"Unsupported character encoding: ","messagePattern":"Unsupported character encoding: ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoader.java","lineNumber":177,"sourceCode":"    try {\n      // use terminator in hex representation due to character set\n      // terminator in hex representation must be in character set\n      // of data file\n      if ( Utils.isEmpty( encoding ) ) {\n        bytes = in.getBytes();\n      } else {\n        bytes = in.getBytes( encoding );\n      }\n      for ( byte aByte : bytes ) {\n        final String hex = Integer.toHexString( aByte );\n\n        if ( hex.length() == 1 ) {\n          out.append( '0' );\n        }\n        out.append( hex );\n      }\n    } catch ( UnsupportedEncodingException e ) {\n      throw new KettleException( \"Unsupported character encoding: \" + encoding, e );\n    }\n\n    return out.toString();\n  }\n\n  /**\n   * Get the contents of the control file as specified in the meta object\n   *\n   * @param meta\n   *          the meta object to model the control file after\n   *\n   * @return a string containing the control file contents\n   */\n  public String getControlFileContents( OraBulkLoaderMeta meta, RowMetaInterface rm, Object[] r ) throws KettleException {\n    DatabaseMeta dm = meta.getDatabaseMeta();\n    String inputName = \"'\" + getFilename( getFileObject( meta.getDataFile(), getTransMeta() ) ) + \"'\";\n\n    String loadAction = meta.getLoadAction();","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkLoader.java#L159-L195","documentation":"encodeRecordTerminator converts the configured record terminator string to bytes in the configured character encoding and renders it as hex for the SQL*Loader control file. If the JVM does not support the configured encoding, UnsupportedEncodingException is caught and rethrown as 'Unsupported character encoding: <encoding>'.","triggerScenarios":"getControlFileContents calls encodeRecordTerminator with an encoding string not recognized by the JVM (Charset.forName/new String equivalent lookup fails).","commonSituations":"Typo in the encoding setting (e.g. 'utf8' vs 'UTF-8', 'UTF_8'); encoding copied from a different platform; running on a JVM with a reduced charset provider (compact profiles).","solutions":["Use a standard IANA encoding name such as UTF-8, ISO-8859-1 or US-ASCII in the loader's encoding setting","Check the JVM's supported encodings (Charset.availableCharsets()) and pick one of those","Fix the typo in the configured encoding value"],"exampleFix":"// before\nmeta.setEncoding( \"utf_8\" );\n// after\nmeta.setEncoding( \"UTF-8\" );","handlingStrategy":"validation","validationCode":"if ( !Charset.isSupported( encoding ) ) {\n  throw new KettleException( \"Unsupported encoding: \" + encoding );\n}","typeGuard":null,"tryCatchPattern":"try {\n  controlFile = OraBulkLoaderMeta.getControlFileContents( meta, transMeta, prev );\n} catch ( KettleException e ) {\n  if ( e.getMessage().startsWith( \"Unsupported character encoding\" ) ) {\n    logError( \"Fix encoding setting: \" + e.getMessage() );\n  }\n}","preventionTips":["Use canonical IANA names: UTF-8, ISO-8859-1, US-ASCII","Validate configured encodings against Charset.isSupported at startup","Do not copy encoding strings from other platforms/tools without checking"],"tags":["oracle","sqlldr","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"}