Looking at the V5.3 source code, the call used to ascertain the current code page is GetConsoleCP()  If that returns 0, we look up the following registry key:

HKEY_LOCAL_MACHINE SYSTEM\CURRENTCONTROLSET\CONTROL\NLS\CODEPAGE\OEMCP

You can use SetConsoleCP() to make a change within your process, or you can always set the MQMD.CodedCharSetId in the aplication.

Russell

Russell Finn  
MQSeries System Test  
[EMAIL PROTECTED]



Rick Miles <[EMAIL PROTECTED]>
Sent by: MQSeries List <[EMAIL PROTECTED]>

27/03/2004 19:37

Please respond to
MQSeries List

To
[EMAIL PROTECTED]
cc
Subject
Re: CCSID and TSH header









Hi Russell,
If I were to run chcp from a DOS command window I would expect it to
display codepage 437 because that is the value in the registry for OEMCP.
However, when a COM+ initiated VB dll runs, I would expect it to run with
the codepage associated with the registry key ACP which is for ASCII
Windows, and is set to 1252.
I remain confused - any insight would be appreciated.
Rick



                                                                                                             
                                                                                                             
             Russell Finn                     To:       [EMAIL PROTECTED]                              
             <[EMAIL PROTECTED]>        cc:                                                            
             Sent by: MQSeries List           Subject:  Re: CCSID and TSH header                            
             <[EMAIL PROTECTED]>                                                                      
                                                                                                             
             03/24/2004 01:25 PM                                                                            
                                                                                                             
             Please respond to MQSeries                                                                      
             List                                                                                            
                                                                                                             
                                                                                                             
                                                                                                             





Rick,

1) That is an internal format.

2) My Windows XP machine has the same registry values as yours.  If I issue
"chcp" in a command prompt it says: "Active code page: 437".

When you do an MQPUT with MQMD.CodedCharSetId=0, this tells MQ that the
data in the body of the message is in the default local CCSID.  MQ replaces
the 0 in this field with the correct local CCSID.

So if I do an MQPUT to an AIX server using MQMD.CodedCharSetId=0, then I
expect the MQMD to end up with CodedCharSetId=437 as that is what chcp
reports.

Hope that helps,

Russell

Russell Finn
MQSeries System Test
MP 211, IBM Hursley, Winchester, SO21 2JN
[EMAIL PROTECTED]

                                                                         
Rick Miles <[EMAIL PROTECTED]>                                    
Sent by: MQSeries List                                                    
<[EMAIL PROTECTED]>                                              To
                                                   [EMAIL PROTECTED]
                                                   T                      
24/03/2004 18:11                                                       cc
                                                                         
                                                                  Subject
             Please respond to                     CCSID and TSH header  
               MQSeries List                                              
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         









Hi all, I have 2 questions that I cannot seem to find an answer to - seems
as though IBM does not understand the question and continues to miss the
mark.
1) What is the format of the TCP TSH header you see in a trace?  For
example:
           Receiving Data:-
       54 53 48 20 00 00 00 40 02 99 30 00 00 00 00 00  : TSH
[EMAIL PROTECTED]
       00 00 00 00 11 03 00 00 B5 01 00 00 00 00 00 40  :
........Â......@
       00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00  :
................
       01 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00  :
................

2) I have a WEB application that is initiated by COM+ on Win2000 and calls
DB2 and MQSeries. This application MQPuts a message to an AIX queue. The
MD.CodedCharSetId is set to MQCCSI_Q_QMGR (zero). In the Win2000 registry
at HKLM\SYTEM\CurrentControlSet\Control\NLS\CodePage I have ACP (Windows
ASCII codepage)=1252, OEMCP (DOS, cmd.exe codepage)=437.
When I trace a MQPut from this client to AIX, the TCP receive of a message
has a TSH header with a codepage=437 and the MD has a codepage=0.  MQ
translates part of the transmission using 437 -> 819 and determines this is
a MQPut. MQ then "puts" the message on the queue, but has now plugged in a
codepage of 437 in the MD - presumably defaulting to the codepage from the
TSH header.
QUESTION is, why is this 437 instead of 1252?  Initially I thought it was
because DB2CODEPAGE was 437, but I removed this setting and restarted DB2
and IIS where the client is ruuning  but still get 437 assigned to the MQ
messages.

Thanks for any insights.
Rick"{-??-???~??jv??x2??Ãj)b?                 b??.n?+??b?v?z??'^v)?Ã?Ã??ÃÚK
?n?×???i?^j?m?

Reply via email to