KB Article #178777
Convert mapping to different encoding throws error: Error writing output file. Disk full or wrong encoding?
Problem
-- Input file is not in desired encoding the output file should have. For example the input file is multi-byte encoding, while the receiver expects single-byte encoded output file.
-- Input file contains characters not existing in target encoding
-- Error when running map is "F-TF 8030: TN:N: :Error writing output file. Disk full or wrong encoding?"
Resolution
Per default, if a map finds a character that cannot be converted to the target encoding, the map will fail. This can be avoided by defining the parameter" output_coding_error_action=1". Instead of failing, jtransform will replace all unknown characters with the character defined in the "output_replace_value" parameter. The default being the question-mark (?). Setting "output_replace_value=#" will replace unmappable characters with the hash symbol (#) instead.
Set the following jtransform parameters:
- encoding_in
- encoding_out
- output_coding_error_action
- output_replace_value
For example for converting a file from UTF-8 to ASCII in a map set the following:
- encoding_in=UTF-8
- encoding_out=ASCII
- output_coding_error_action=1
- output_replace_value=#
These parameters can be set in the workflow itself or in the parametertable lib/convert/param.jtf. While the former two are recommended to be defined in the workflow, the latter two might be more suited for the parameter table to take effect on all jtransform calls.
** 'output_coding_error_action' description in the TechOnDoc: "Set the error action on malformed bytes (bytes not in the encoding parametrized by encoding_out). 0 means ignore, 1 means replace by output_replace_value, 2 means report as an error. Value 0 Value 1 Value 2". "Default: 2"