Skip to main content

How to correctly display OEM characters under Dialog System?

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Applications initially developed with COBOL WorkBench use the OEM format for data when Net Express ( and Dialog System of Net Express) use ANSI format.

How to correctly display OEM characters under Dialog System?

Resolution:

Add the following Function at the Global Dialog

SCREENSET-INITIALIZED

     

CALLOUT-PARAMETER 1 CONFIG-FLAG $NULL

     

CALLOUT-PARAMETER 2 CONFIG-VALUE $NULL

     

MOVE 16 CONFIG-FLAG

     

MOVE 1 CONFIG-VALUE

     

CALLOUT "dsrtcfg" 3 $PARMLIST

this dsrtcfg call is documented in Dialog System:

Display Character Set Conversion

By default, the Dialog System run-time assumes that data passed to it is encoded for correct display in Windows environments, that is, the passed data will have a correct visual representation when Windows displays the characters using the ANSI character set.

We recognize, however, that the wide variety of sources of data used by COBOL applications will not always conform to the ANSI format. These data sources have typically been created using non-Windows, that is OEM, character set data.

In these circumstances, Dialog System provides a means of converting the data to and from ANSI format, for display and comparison means.

This is of particular use to European countries which make use of diacritical characters, for which the ANSI value representing the required character (for example, an umlaut) differs from the OEM value (with which it was created) for that character.

To use an OEM data source and enable the conversion, the following dialog must always be added in Dialog before attempting to display data of this format:

  CALLOUT-PARAMETER 1 CONFIG-FLAG $NULL

  CALLOUT-PARAMETER 2 CONFIG-VALUE $NULL

  MOVE 16 CONFIG-FLAG

  MOVE 1 CONFIG-VALUE

  CALLOUT "dsrtcfg" 3 $PARMLIST

A CONFIG-VALUE set to zero will disable the conversion mechanism.

The conversion mechanism in Dialog System will re-format the output data using standard Windows API calls, and display the resulting converted data. The OEM values in the data block will remain unaffected, but you should note that display of Master fields in excess of 255 characters may be altered.

When the Dialog System run-time encounters a data block master field greater than 255 characters, any manipulation or GUI object population is implemented direct from the linkage to the DSGRUN program. In this case, the relevant field will be null-terminated - any character in the last position for that field will be overwritten with X"00".

....

Old KB# 6553

0 replies

Be the first to reply!