This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ssh-host-config produces Win32 error 1057 on systems with non-ASCII computer names


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]