title: How to set CCSID for MQQueueManager from code?
body: <p>I have some strange problem. I think I followed documentation correctly but my code doesn't work. I have this very simple hard coded test (NUnit):</p>
  
  <pre><code>[TestFixture]
  public class MQQueueTests {
  
      public const string MessageContent = "&lt;test&gt;This is test message&lt;/test&gt;";
  
      public static void Main(string[] args) {
          var tests = new MQQueueTests();
          tests.PutAndGetMessage();
      }
  
      [Test]
      public void PutAndGetMessage() {
          var properties = new Hashtable
                               {
                                   {MQC.HOST_NAME_PROPERTY, "TestServer"},
                                   {MQC.CHANNEL_PROPERTY, "Test.Channel"},
                                   {MQC.PORT_PROPERTY, 1415},
                                   // Is this correct? It looks like it is not 
                                   // enough because adding this line didn't solve 
                                   // the problem.
                                   {MQC.CCSID_PROPERTY, 437}  
                               };
  
          using (var manager = new MQQueueManager("Test.Queue.Manager", properties)) {
              using (MQQueue queue = manager.AccessQueue("Test.Queue", 
                  MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_AS_Q_DEF)) {
  
                  MQMessage message = new MQMessage();
                  message.WriteUTF(MessageContent);
                  queue.Put(message);
  
                  MQMessage readMessage = new MQMessage();
                  queue.Get(readMessage);
  
                  Assert.AreEqual(MessageContent, readMessage.ReadUTF());
  
                  queue.Close();
              }
              manager.Disconnect();
          }
      }
  }
  </code></pre>
  
  <p>I'm running the test application either from console or through Resharper 6 test runner. If I run the application in test runner I always get following exception:</p>
  
  <blockquote>
    <p>IBM.WMQ.MQException : MQRC_CHANNEL_CONFIG_ERROR (reason code is 2539)</p>
  </blockquote>
  
  <p>The exception is thrown by <code>MQQueueManager.Connect</code> (called by its constructor).</p>
  
  <p>If I check MQ logs I see:</p>
  
  <blockquote>
    <p>AMQ9541: CCSID supplied for data conversion not supported.</p>
    
    <p>EXPLANATION: The program ended because, either the source CCSID '437'
    or the target CCSID '852' is not valid, or is not currently supported.</p>
    
    <p>ACTION: Correct the CCSID that is not valid, or ensure that the
    requested CCSID can be supported.</p>
  </blockquote>
  
  <p>If I run the application from the console I got the same error but if I change the code page for console by calling </p>
  
  <pre><code>chcp 437
  </code></pre>
  
  <p>My test application works. How can I configure code page from code?</p>