Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Integration Server Built-In Services | Utils Folder | Summary of Elements in this Folder | pub.utils:transcode
 
pub.utils:transcode
WmPublic. Transcodes data from one encoding to another.
Input Parameters
inputData
Document Data to be transcoded. Depending on the data type of the source data, use string or bytes variable to specify the data.
You must provide input data to string or bytes. If you do not specify input data in either string or bytes, the pub.utils:transcode service ends with an exception. If you specify input data for both string and bytes, the pub.utils:transcode service uses the contents of string, ignoring bytes.
Key
Description
string
String Optional. String containing the data to convert to another encoding
bytes
byte[ ] Optional. Sequence of bytes to convert to another encoding.
sourceEncoding
String Encoding used for the source data. This must be an encoding supported by the JRE used with Integration Server.
targetEncoding
String Encoding to which the source data needs to be transcoded. This must be an encoding supported by the JRE used with Integration Server.

onTranscoding
Error
String Optional. Specifies the action to take when encountering unmappable characters. When transcoding data from one character set to another, it is possible that a character in the source encoding cannot be mapped to a character in the target encoding. Specify one of the following:
*replace to replace an unmappable character with a replacement character. If you select replace, specify a replacement character in replaceWith.
*ignore to drop any unmappable characters.
*report to throw a ServiceException if the service encounters any unmappable characters. This is the default.
replaceWith
Document Optional. Character used to replace an unmappable character found during transcoding. Specify a replacement character for characters that cannot be mapped in string or bytes.
The pub.utils:transcode service uses a replacement character only when onTranscodingError is set to replace.
If onTranscodingError is set to replace and a replacement character is not specified, the pub.utils:transcode service uses the default replacement character of space (“\u0020”).
If you specify a replacement character for both string and bytes, the pub.utils:transcode service uses the contents of string, ignoring bytes.
Key
Description
string
String Optional. The replacement character to use for unmappable characters in the input data.
bytes
byte[ ] Optional. The replacement character to use for unmappable characters in the input data.
outputAs
String Optional. The data type to use for the output data. Specify one of the following:
*string
*bytes
If you do not specify a value for outputAs, the pub.utils:transcode service returns the output in the same data type used for inputData. For example, if you supplied the source data to inputData/string, the service returns the target data to the outputData/string output parameter.
normalizationForm
String Optional. The Unicode normalization form to use during transcoding. Specify one of the following:
*none indicates that normalization is not done.
*NFC (Normalization Form C). Canonical Decomposition, followed by Canonical Composition. This is the default.
*NFD (Normalization Form D). Canonical Decomposition.
*NFKC (Normalization Form KC). Compatibility Decomposition, followed by Canonical Composition
*NFKD (Normalization Form KD) Compatibility Decomposition.
Output Parameters
outputData
Document Transcoded data. The pub.utils.:transcode service returns the transcoded data in outputData/string or outputData/bytes, depending on the value of the outputAs input parameter. If a value was not specified for outputAs, the service returns the transcoded data in the same data type as the supplied input data.
Key
Description
string
String Conditional. Transcoded contents of inputData as a String. The pub.utils:transcode service returns this output parameter if the input data was supplied in inputData/string or outputAs was set to string.
bytes
bytes[] Conditional. Transcoded contents of inputData as a byte[]. The pub.utils:transcode service returns this output parameter if the input data was supplied in inputData/bytes or outputAs was set to bytes.