8.4.6 Data Encoding Directives

It is strongly recommended that you use UTF-8 encoding between different platforms/systems. This way you can be confident that the data will arrive with no code page translation issues.

UTF-8 byte encoding is only used to send text data across a socket connection.

UTF-8 encoding is the main byte encoding used between systems because it represents every character.

When UTF-8 encoded data arrives into the service it is converted to Unicode. When data transfer occurs between the LANSA function and JSM on the IBM i, EBCDIC to Unicode conversion is done and visa versa.

 

PC (local) <--- Cp1252 ---> UserAgent (Unicode) <------> UTF-8 <-----> JSM (Unicode) <----- CCSID 37 ---> LANSA function

 

XML source content will be read by the UserAgent using an auto-detect method and no encoding selection is required.

By default, all text and XML content will be converted to a byte stream using the charset value specified on the file extension / MIME type entry. The XML declaration encoding will be modified to suit the selected encoding.

Refer to IANA Encodings for more details.

Data Source Text Encoding (Send)

Keyword

Comments

local.read.text.encoding

Used by the user agent to read a local text file and create a Unicode data source string.

The following rules determine the encoding:

If a local.read.text.encoding entry exists then use this value to convert the text bytes into Unicode.

If no local.read.text.encoding entry exists then use the JVM default encoding.

remote.write.text.encoding

Used by the user agent to convert the Unicode data source string into a byte stream to send to the remote host.

The following rules determine the encoding:

Use the charset value that exists on the content-type associated with the file extension.

If no charset , then use the remote.write.text.encoding entry.

If no remote.write.text.encoding entry exists then use the JVM default encoding.

 

 

Data Response Text Encoding (Receive)

Keyword

Comments

remote.read.text.encoding

Used by the user agent to convert the received HTTP byte content into a Unicode data response string.

The following rules determine the encoding:

Use the charset value that exists on the HTTP response protocol content-type.

If no charset , then use the remote.read.text.encoding entry.

If no remote.read.text.encoding entry exists then use the JVM default encoding.

local.write.text.encoding

Used by the user agent to convert the Unicode data response string to the required local encoding.

The following rules determine the encoding:

If a local.write.text.encoding entry exists then use this to convert Unicode to bytes.

If no local.write.text.encoding entry exists then use the JVM default encoding.

 

 

Data Response XML Encoding (Receive)

Keyword

Comments

remote.read.xml.encoding

Used by the user agent to convert the received XML byte content into a Unicode data response string.

The following rules determine the encoding:

If a remote.read.xml.encoding entry exists then use this to convert bytes to Unicode.

If no remote.read.text.encoding entry exists then the default method is *charset.

If the value is *charset then use the charset value. If no charset is available then auto-detect.

If the value is *autodetect then auto-detect the encoding.

local.write.xml.encoding

Used by the user agent to convert the Unicode XML data response string to the required local encoding.

The following rules determine the encoding:

If a local.write.xml.encoding entry exists then use this to convert Unicode to bytes.

If no local.write.text.encoding entry exists then the default method is *charset.

If the value is *charset then use the charset value. If no charset is available then use the JVM default encoding.

If the value is *default use the JVM default encoding.

If the value is *text use the local.write.text.encoding method.