delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/03/06/06:26:45

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 6 Mar 2013 12:25:48 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: ssh-host-config produces Win32 error 1057 on systems with non-ASCII computer names
Message-ID: <20130306112548.GF25458@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <513719BE DOT 4030004 AT ehnberg DOT net> <20130306103939 DOT GF14373 AT calimero DOT vinschen DOT de> <5137244E DOT 5030809 AT ehnberg DOT net>
MIME-Version: 1.0
In-Reply-To: <5137244E.5030809@ehnberg.net>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mar  6 13:11, Johan Ehnberg wrote:
> On 2013-03-06 12:39, Corinna Vinschen wrote:
> >This is the fault of the cygrunsrv tool, which still uses the
> >ANSI variants of the Win32 API.  The default codeset under Cygwin
> >is UTF-8, but that doesn't match your Windows ANSI codepage 1252,
> >so that's what probably goes wrong.
> >
> >Cygrunsrv has to be changed to use the UNICODE variants of the
> >Windows Service API to get that working.
> 
> Thank you for the prompt answer, it seems to be just on the spot.
> 
> For future reference, the default codepage for this Windows variant,
> as reported by chcp, is 850.

Hang on.  This is the default OEM codepage, not the default ANSI
codepage.  The OEM codepage is what CMD uses, the ANSI codepage is what
Explorer and other GUI tools and especially the Win32 ANSI API uses by
default.

> Using codepage 1252 works mostly, but
> will garble up cmd with some characters and may cause trouble in
> batch scripts with non-ASCII characters.

What you can try is this:  Start mintty, open the Options dialog,
and set your Locale to the POSIX "fi_FI" and the charcter set to
"CP1252".  Store the result, close mintty and start it again.
Now your Cygwin tools will use the same codeset as the Windows ANSI
API.  Now try ssh-host-config again.  In theory, that should work.

> Interestingly, Notepad does
> not support codepage 850 but uses codepage 1252 on the same system.
> This can fool the user and mess up scripts after edits.
> 
> On the other hand, I have understood that Windows is also known for
> not running Unicode batch scripts properly - changing cygrunsrv
> alone may not yet solve this for automated batch script
> installations?

Yes it will.  Cygwin tools use the Cygwin codeset as defined by
the $LANG environment variable.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019