The isCOBOL Encoding
If national items cannot be used, and standard alphanumeric items are used instead, special characters are handled by the Framework according to the current encoding set in the environment. To force the Framework to use a particular encoding overriding the operating system settings, you must set the
iscobol.encoding * configuration property. For example, in order to force UTF-8 as current encoding for the COBOL application, you add the following entry to the configuration:
The above setting affects standard i-o operations. The isCOBOL Framework will use the specified encoding to represent data on the video after reading and to convert data before writing.
When managing special characters using standard alphanumeric items, you must pay attention to offsets. For example, if you reference a variable by specifying offset and length between parenthesis, like:
consider that 2 means the second byte and not the second digit, so, if the first character of var needs two or more bytes to be represented with the current encoding, the result of the COBOL operation will be a truncated string.