IBM Support

How to find the CCSID value associated with the coded character set for a locale in a UNIX session

Troubleshooting


Problem

You want to find the CCSID associated with the locale and coded character set used for your UNIX session. The WebSphere MQ Information center does not explain the commands used to determine the CCSID value. This document provides the instructions and examples.

Resolving The Problem


To find the value for the Coded Character Set Identifier (CCSID) that can be used with MQ (such as with the environment variable MQCCSID) do the following:

1: Login with a userid that has authority to use MQ.

2: From the UNIX command prompt, type the locale command:

    locale

The output of "locale" should be something like this:

LANG=en_US
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_MESSAGES="en_US"
LC_ALL=

Note: The locale "en_US" is for the English language in the United States.

3: Find the "codeset name" associated with the locale:
    locale charmap

The output of "locale charmap" is the "codeset name" for the locale, and it should be something like this:

ISO8859-1

4: See : MQ product documentation for the mapping between the "codeset name" and the "CCSID" value:

WebSphere MQ 8.0.0 > WebSphere MQ > Reference > Developing applications reference > MQI applications reference > Code page conversion >
Codeset names and CCSIDs

PDF Manual: MQ Reference, Version 7.5
Page 2445
Codeset names and CCSIDs
Table 226. Codeset names and CCSIDs

PDF Manual: MQ Application Programming Reference (APR), Version 6
Appendix G. Code page conversion
Codeset names and CCSIDs
Table 91. Codeset names and CCSIDs

+++ Note about UTF-8:

There is no explicit entry for the codeset name of "UTF-8" in that table, but the corresponding CCSID value is "1208".

Example for AIX:
You are using the locale "en_US". What is the CCSID?

$ locale
LANG=en_US
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_MESSAGES="en_US"
LC_ALL=

$ locale charmap
ISO8859-1

The code set name is ISO8859-1 and from the mentioned Appendix , the value for CCSID is 819.


Example for Linux:
You are using the locale "en_US.UTF-8". What is the CCSID?

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

$ locale charmap
UTF-8

The codeset name is UTF-8 and from the "Note about UTF-8" in this technote, the CCSID is 1208.

+++ Mapping of locale and code set / CCSID

- The MQ 5.3 Quick Beginnings for <operating system> manuals have a table that shows the locale and the corresponding code set and CCSID, in "Chapter 10. Code sets supported by WebSphere MQ"
- The MQ Quick Beginnings manuals for Version 6 and 7, nor the MQ V8 product documentation no longer have this information.

[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Data Conversion","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"8.0;7.5;7.1;7.0;6.0","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

WebSphere MQ WMQ

Document Information

Modified date:
15 June 2018

UID

swg21233177