You are here: Multilingual Application Design > 6. Tips and Techniques > 6.10 Multilingual Text Handling > 6.10.1 Does LANSA know the correct CCSID to use for Multilingual text?

6.10.1 Does LANSA know the correct CCSID to use for Multilingual text?

Partition multilingual languages are processed in the Work With Partition Multilingual Attributes menu item. The two values, IBM i EBCDIC CCSID and Windows ANSI code page are stored in F60CHR in DC@F60.

 

IBM i EBCIC CCSID . . . . . . .

Windows ANSI code page . . . . . .

 

 

Any future references to F60CHR (or X60CHR) in this section is referring to the IBM i EBCDIC CCSID and Windows ANSI code page values specified for a language.

You are responsible for ensuring the IBM i F60CHR values and windows X60CHR values are valid (and up-to-date on the PC if changed on the IBM i). LANSA uses the default values listed in the table following when X60CHR has a blank value.

DBCS languages must be set to the correct code for the language, otherwise DBCS translation will not be performed correctly by Host Monitor. For example, Korean MUST use KOR.

All languages that are in the following table should use the listed LANSA language code otherwise the defaulting of the IBM i CCSID and Windows codepage will not be correct. If a language is not listed, then X60CHR must be specified. Amongst other things this affects Host Monitor, multilingual text and source code multilingual text.

F60CHR in DC@F60 is set using Multilingual Partition SAA / CUA Defaults. The two fields are IBM i EBCDIC CCSID and Windows ANSI codepage. For further information, see Review or Change a Partition's Multilingual Attributes in the LANSA for i User Guide.

If a default value is needed on Windows, it is calculated by first by looking up the language in ccsid.txt. If the language is not found there, the current operating system codepage is used.

This table is formatted as follows:

LANSA Language

IBM I Language

IBM i CCSID

Windows Codepage

ENG

ENU

1140

1252

ARA

ARA

420

1256

CAT

CAT

284

1252

CES

CSY

870

1250

CZE

CSY

870

1250

DAN

DAN

1142

1252

DEU

DEU

1141

1252

DUT

NLD

1140

1252

ELL

ELL

875

1253

ESP

ESP

1145

1252

FIN

FIN

1143

1252

FRA

FRA

1147

1252

FRB

FRB

1148

1252

FRC

FRC

1148

1252

GRE

ELL

875

1253

HEB

HEB

424

1255

ITL

ITA

1144

1252

JPN

JPN

5026

932 

KOR

KOR

933

949 

NOR

NOR

1142

1252

POR

PTG

1140

1252

SCHI

CHS

935

936 

SFRA

FRS

1148

1252

SWE

SVE

1143

1252

TCHI

CHT

937

950 

THA

THA

9030

874 

TRK

TRK

1026

1254

TUR

TRK

1026

1254

 

 

On IBM i the fallback position is the same table as for Windows, using the IBM i CCSID. But prior to that an algorithm is used to obtain a best default CCSID if possible. The algorithm is currently as follows and may be changed at any time by LANSA.

 

static void GetCCSID( char * pvchLanguage, UTC_CodePage * pCodePage )

{

 

   Get the job CCSID

 

   /* Check if the Job CCSID overides the default */

   if ( JobCCSID == 500 || JobCCSID == 1148 )

   {

      if ( language is one of FRB, FRC, DEU, DUT, FIN, ITL, NOR, POR, SWE or SFRA)

      {

         Set codepage to the Job CCSID (500 or 1148)

      }

   }

 

   if ( language is ENG )

   {

      if ( JobCCSID == 285 || JobCCSID == 37 || JobCCSID == 1146 || 

           JobCCSID == 500 || JobCCSID == 1148 )

      {

         Set codepage to the Job CCSID

      }

      else

      {

         Set codepage to 1140

      }

   }

   else if ( language is FRA )

   {

      if ( JobCCSID == 297 || JobCCSID == 500 || JobCCSID == 1148 )

      {

         Set codepage to the Job CCSID

      }

      else

      {

         Set codepage to 1147

      }

   }

   else if ( language is ESP )

   {

      if ( JobCCSID == 284 || JobCCSID == 500 || JobCCSID == 1148 )

      {

         Set codepage to the Job CCSID

      }

      else

      {

         Set codepage to 1145

      }

   }

   else if ( language is JPN )

   {

      /* This is a workaround for QLGRTVDC which returns 5026 unless the 

         QTQ_DEFAULT_CCSID environment variable is explicitly set to 5035 */

      if ( JobCCSID == 5035 )

      {

         Set codepage to the Job CCSID

      }

   }

 

   if ( codepage has been set )

   {

      return;

   }

 

   /* Convert LANSA Lang Id -> IBM I  Lang Id */

   if (language code found in table)

   {

        Set codepage to the CCSID in the table.

        Set IBM i language code to the value in the table (i.e. map from LANSA to IBM)

      }

   }

   else

   {

      Set IBM i language code to the LANSA language code.

   }

    if ( IBM i language code is a valid IBM language code )

   {

      /* QLGRTVDC only works on systems >= V5R2 */

      P8601_GetOSReleaseNumber( &releaseNo, &chRetCode );

 

      if  ( release >= V5R2 use IBM language code to obtain the "Input CCSID")

      {         Set codepage to the Input CCSID

      }

      /* else the default will be used as set above when language code found in */

      /* Note that if the language code is NOT found in the table and the OS400 */

      /* release is BEFORE V5R2 then the codepage is not set. This implies that*/

      /* in this case an override MUST be provided in F60CHR.                   */

   }

   else

   {

      /* Unrecognised language requested. Use default JobCCSID. No distinction

         is required at the moment between LLL (special language code) and

         other unrecognised language codes */

 

      if ( JobCCSID != 0 )

      {

         Set codepage to the Job CCSID

      }

      else

      {

         Set codepage to 1140

      }

 

      if ( language is not LLL )

      {         if ( message not yet issued for this language )

         {

            Issue log message 

                     "Language code not recognised: %s. Using default Job CCSID %ld",

                     vchISeriesLang,

                     *pCodePage );

         }

      }

   }