Unicode Input and Output Handling in Natural Applications

The Natural runtime environment is enabled for Unicode support. Unicode characters are converted to the default code page (value of the system variable *CODEPAGE) before they are displayed on the terminal. Unicode characters which have no equivalent in the default code page are replaced by a substitution character.

With the Natural Web I/O Interface under SPoD, Unicode characters are fully supported by the terminal emulation. In this case, U format fields are displayed and can be entered correctly as Unicode. They are not converted to the equivalent in the default code page. The Natural Web I/O Interface is activated by the Natural Development Server configuration parameter TERMINAL_EMULATION=WEBIO. The system variable *DEVICE contains BROWSER.

This document covers the following topics:


Displaying and Entering Unicode Data

Notes:

  1. Unicode data cannot be displayed on 3270 terminals.
  2. When running applications with Natural for Mainframes, see Natural Web I/O Interface Client below.

If you run Natural via a terminal emulation or a mainframe terminal such as IBM 3270/3279, the page will be converted to the default code page (value of the system variable *CODEPAGE) before displaying it, so that all characters which are not contained in the default code page are replaced with the substitution character. Equally, input is only possible in code page format and will be converted to Unicode format before assigning it to a U format field. You have to regard that the substitution character is defined by the ICU conversion tables. Depending on this character, it is possible that garbage is displayed with a terminal emulation. However, it is strongly recommended that you use the Natural Web I/O Interface when displaying characters not contained in the default code page.

On code page oriented mainframe terminals, it is important to select the suitable code page. The default code page of Natural, the code page of the terminal and even the font used by the terminal determine the capability of displaying certain characters correctly.

Natural Web I/O Interface Client

Full Unicode I/O is only supported at runtime with the Natural Web I/O Interface. If an application is run in the terminal emulation and Unicode strings are displayed, some Unicode characters may not be displayed correctly.

The Natural Web I/O Interface client is used to display non-GUI information which contains Unicode characters. It can be used in the following environments:

SPoD Environment

The Natural Web I/O Interface client can be invoked when you use Natural for Windows and you are working with Natural Studio in a remote development environment (SPoD); see Natural Web I/O Interface Client in Remote Development Using SPoD which is part of the Natural for Windows documentation.

When the Natural Web I/O Interface client is used, the Web I/O window appears instead of the terminal emulation window which is not Unicode-enabled in mainframe environments.

The following graphic shows the SPoD environment for Unicode applications with Natural Development Servers (NDV) on mainframes:

SPoD environment

So that the Natural Web I/O Interface client can be invoked, the Natural Development Server has to be configured as follows:

  • If you want to use the Natural Web I/O Interface client in a remote mainframe environment, the NDV configuration parameter TERMINAL_EMULATION must be set to WEBIO on the NDV server. See NDV Configuration Parameters in the Natural Development Server documentation. The Natural profile parameter TMODEL can be used to determine the user screen size.

Runtime Environment

The Natural Web I/O Interface client appears when running applications with Natural. It runs in a web/application server.

The following graphic shows the runtime environment for Unicode applications:

Runtime environment

Natural recognizes automatically whether the session has been started from the Natural Web I/O Interface client or from the terminal emulation.

It is required that the Natural Web I/O Interface server has been installed and configured. See Natural Web I/O Interface. Moreover, the Web I/O terminal converter module NATWEB must be linked to the Natural nucleus. The Natural profile parameter TMODEL can be used to determine the user screen size.