Decode Commands Without a Keyword

The current approach for localization uses a keyword to decode all of the command output. For details, see the step about retrieving a keyword from the resource bundle in Define a New Job to Operate With Localized Data.

However, another approach uses a keyword to decode the first command output only, and then decodes further commands with the character set used to decode the first command. To do this, you use the getCharsetName and useCharset methods of the ShellUtils object.

The regular use case works as follows:

  1. Invoke the executeCommandAndDecode method once.

  2. Obtain the most recently used character set name through the getCharsetName method.

  3. Make shellUtils use this character set by default, by invoking the useCharset method on the ShellUtils object.

  4. Invoke the execCmd method of ShellUtils one or more times. The output is returned with the character set specified in the previous step. No additional decoding operations occur.

Parent topic: Support Localization in Jython Adapters