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

Technote (troubleshooting)


Problem(Abstract)

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:

  • Login with a userid that has authority to use MQ.
  • 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.
  • 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
  • See : MQ Information center for the mapping between the "codeset name" and the "CCSID" value:

Codeset names and CCSIDs

Manual: MQ Application Programming Reference (APR), Version 7
Chapter 11. Code page conversion
Codeset names and CCSIDs
Table 104. Codeset names and CCSIDs

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.

Additional references
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 no longer have this information.

Related information

APR - Codeset names and CCSIDs
MQ V6 Information Center
MQ V5.3 manuals

Product Alias/Synonym

WebSphere MQ WMQ

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere MQ
Data Conversion

Software version:

6.0, 7.0, 7.1, 7.5

Operating system(s):

AIX, HP-UX, Linux, Solaris

Software edition:

All Editions

Reference #:

1233177

Modified date:

2013-09-18

Translate my page

Machine Translation

Content navigation