X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21030398B15A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1617956988;
	bh=pYVw9zz6a19xKm+EwVlR9EbhPdhyiwMa7m2xHJH+tF0=;
	h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=Zi4d6AlFyfcJDXJAv2PhGAf/cscXqAdyEowRexGr58zpfA4o1m835GaxbzExyPcIg
	 zVZmZ4z4g9dVBTMVhbCmtBcLlIOfPmSjFVg6f5n0qXZOciZ1cjVvKF4SIghauDaJNp
	 iz1XkIXHlFNXwYZFlTV3uBhak1SOR9zUcvYyJjsg=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 21147385DC30
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 1398T4rQ016193
X-Nifty-SrcIP: [124.155.50.190]
Date: Fri, 9 Apr 2021 17:29:05 +0900
To: cygwin@cygwin.com
Subject: Re: IBM MQ client application fails on latest cygwin
Message-Id: <20210409172905.65fe302c88430607afb4f4f3@nifty.ne.jp>
In-Reply-To: <CA+7cx1pHjrb4q0qLKHakqdxOuygw+LP1QUf_9sawVA10paG-xQ@mail.gmail.com>
References: <CA+7cx1p2BNhah1wNB2gNPVDR6y6eXD44ALFaUhjcinJuVOFWRw@mail.gmail.com>
 <20210406233716.003ba116ca61f99632bb4dce@nifty.ne.jp>
 <CA+7cx1o-Npm_ne8v+EB1QfCYPEZ4GB4dJSn3bQozEMm9pK4RgQ@mail.gmail.com>
 <20210407195624.d77b7459cbdd63504ea495d4@nifty.ne.jp>
 <20210407200441.860d8b421bf7d29d1e32a6ea@nifty.ne.jp>
 <CA+7cx1rN2pkwV0P=jLQWKcuAU5hcvAgzsCD5si-wn4uk+fDthg@mail.gmail.com>
 <20210408201600.9f70ffa0b828a785e70a891c@nifty.ne.jp>
 <20210408212559.bfa088414864757d8c7dc19d@nifty.ne.jp>
 <CA+7cx1p-JtS4Awoh6qsjPwULcnd0R94+fy+tndVRQ6dnsHajow@mail.gmail.com>
 <20210408230404.5083209095d8a184dd0b4de7@nifty.ne.jp>
 <CA+7cx1qzAQ8uAGVWBV8SjN=1sP9CRTEnXXr60+HBmmtMSS3zCw@mail.gmail.com>
 <CA+7cx1oUT6tDq+QP303Q7xa-2J_n-faCLtkxhF78Pb67-uvmPw@mail.gmail.com>
 <20210409092225.7117a11cb457dd94743b6965@nifty.ne.jp>
 <CA+7cx1pCOrK8fjJGWsPmf3v=ZxOubp-2WmJuhxnaZ-n13O6kLw@mail.gmail.com>
 <CA+7cx1pHjrb4q0qLKHakqdxOuygw+LP1QUf_9sawVA10paG-xQ@mail.gmail.com>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
 SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin@cygwin.com>
Reply-To: Takashi Yano <takashi.yano@nifty.ne.jp>
Content-Type: text/plain; charset="utf-8"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 1398ToTV022692

On Fri, 9 Apr 2021 07:54:35 +0200
Morten Kjærulff wrote:
> On Fri, Apr 9, 2021 at 7:26 AM Morten Kjærulff wrote:
> >
> > On Fri, Apr 9, 2021 at 2:22 AM Takashi Yano wrote:
> > >
> > > On Thu, 8 Apr 2021 18:30:25 +0200
> > > Morten Kjærulff wrote:
> > > > Could it be a codepage issue?
> > >
> > > Maybe.
> > >
> > > What does chcp.com say in command prompt and in mintty?
> >
> > 850
> >
> > > In cygwin 3.2.0, the codepage, when pseudo console is disabled,
> > > has been changed from the default codepage of the system to
> > > UTF-8 (65001). If pseudo console is disabled in your environment
> > > for some reason, this can affect.
> > >
> > > Please try to change the codepage using chcp.com to the default
> > > codepage of the system.
> >
> > Then it works:
> >
> > $ cmd
> > Microsoft Windows [Version 10.0.17763.1817]
> > (c) 2018 Microsoft Corporation. Alle rettigheder forbeholdes.
> >
> > C:\mhome>set MQSERVER=BROWSE/TCP/mvs1(1414)
> > set MQSERVER=BROWSE/TCP/mvs1(1414)
> >
> > C:\mhome>chcp
> > chcp
> > Active code page: 65001
> >
> > C:\mhome>amqsbcgc Q
> > amqsbcgc Q
> >
> > AMQSBCG0 - starts here
> > **********************
> >
> >  MQCONNX failed with CompCode:2, Reason:2539
> > C:\mhome>chcp 850
> > chcp 850
> > Active code page: 850
> >
> > C:\mhome>amqsbcgc Q
> > amqsbcgc Q
> >
> > AMQSBCG0 - starts here
> > **********************
> >
> >  MQOPEN - 'Q'
> >  MQOPEN failed with CompCode:2, Reason:2085
> >  MQDISC
> > C:\mhome>

Yeah! Your speculation that this is the codepage issue,
seems correct.

> > > The default codepage of the system is used also when the
> > > pseudo console is activated, so if possible, I recomend to
> > > enable it somehow.
> > >
> > > The reason why pseudo console is disabled, can be one of:
> > > - The system is older than Win10 1809.
> > > - disable_pcon is set in environment variable CYGWIN.
> > > - Terminal does not have enough capability to enable it. (e.g. TERM=dumb)
> > > - The "Legacy console" mode is enabled.
> > >   https://docs.microsoft.com/en-us/windows/console/legacymode
> >
> > For some reason I was running in legacy mode. Turning it off, make
> > chcp display '0' under mintty, but my MQ client works:
> >
> > $ cmd
> > Microsoft Windows [Version 10.0.17763.1817]
> > (c) 2018 Microsoft Corporation. Alle rettigheder forbeholdes.
> >
> > C:\mhome>chcp
> > Active code page: 0
> >
> > C:\mhome>set MQSERVER=BROWSE/TCP/mvs1(1414)
> >
> > C:\mhome>amqsbcgc Q
> >
> > AMQSBCG0 - starts here
> > **********************
> >
> >  MQOPEN - 'Q'
> >  MQOPEN failed with CompCode:2, Reason:2085
> >  MQDISC
> > C:\mhome>
> >
> > >
> > > --
> > > Takashi Yano
> 
> Sorry for replying personally and not to the group.
> 
> I have a virtual machine with Windows 7.
> It is also a problem here, but here I don't have "legacy mode" in the
> command prompt properties.
> Any tricks?

In Windows 7, console is always in "Legacy mode".
Moreover, pseudo console is not supported in Win7.

Therefore, the simplest way is changing codepage
to appropriate value before executing MQ client.

Another solution is to start mintty with charset
option, such as:
mintty -o locale=da_DK -o charset=CP850


This default codepage change from cygwin 3.1.7 was the
anguished choice.
https://cygwin.com/pipermail/cygwin-patches/2020q3/010627.html

If you are interested in this topic, please reffer
to the discussion started from:
https://cygwin.com/pipermail/cygwin-developers/2020-August/011951.html

I still think that it is not good idea to output
UTF-8 string regardless of locale setting. However,
some apps do that... :(

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

