public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Set localisation locale of Windows netstat?
@ 2023-11-22 23:25 Cedric Blancher
  2023-11-23 15:36 ` Corinna Vinschen
  2023-11-24 14:41 ` Andrey Repin
  0 siblings, 2 replies; 3+ messages in thread
From: Cedric Blancher @ 2023-11-22 23:25 UTC (permalink / raw)
  To: cygwin

Good morning!

How can I set the localisation locale of Windows netstat cmd from
Cygwin? LC_ALL=C does not help, a French or German Windows will use
French or German language still

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Set localisation locale of Windows netstat?
  2023-11-22 23:25 Set localisation locale of Windows netstat? Cedric Blancher
@ 2023-11-23 15:36 ` Corinna Vinschen
  2023-11-24 14:41 ` Andrey Repin
  1 sibling, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2023-11-23 15:36 UTC (permalink / raw)
  To: cygwin

On Nov 23 00:25, Cedric Blancher via Cygwin wrote:
> Good morning!
> 
> How can I set the localisation locale of Windows netstat cmd from
> Cygwin? LC_ALL=C does not help, a French or German Windows will use
> French or German language still

Cygwin has no influence on how non-Cygwin tools are doing their job.
They typically don't understand the POSIX-compatible locale environment
strings, and afaik, they don't support $LC_* at all, only $LANG.

And it's getting worse: If you have a localized version of the tools,
there's no guarantee that the locale data of other languages is even
present on your system.  US English is the only common denominator, but
I wouldn't bet on it...

Having said that, LANG=C *should* work, but, of course, there's no
guarantee that a Windows builtin tool will even deign to honor $LANG.

There is some description of the possible locale expressions
supported in $LANG on https://learn.microsoft.com/, it's just that the
search algorithm on that site is incredibly unhelpful at times...


Corinna

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Set localisation locale of Windows netstat?
  2023-11-22 23:25 Set localisation locale of Windows netstat? Cedric Blancher
  2023-11-23 15:36 ` Corinna Vinschen
@ 2023-11-24 14:41 ` Andrey Repin
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Repin @ 2023-11-24 14:41 UTC (permalink / raw)
  To: Cedric Blancher, cygwin

Greetings, Cedric Blancher!

> How can I set the localisation locale of Windows netstat cmd from
> Cygwin? LC_ALL=C does not help, a French or German Windows will use
> French or German language still

Use "chcp 65001" in your .bashrc or an equivalent file.
Many windows console tools will resort to English if they do not recognize
console code page. This includes netsh, netstat and ipconfig.

To make your life easier (i.e. not to type "chcp.com" every time), place a
script named something like "install-chcp-link.dash" in /etc/postinstall/ with
content along the lines of

> #!/bin/dash
>
> [ -f /usr/local/bin/chcp ] || {
>   ln -fsT "$( cygpath -S )/chcp.com" /usr/local/bin/chcp
> }
>
> exit 0

and it will create a link on the next fill setup run.


-- 
With best regards,
Andrey Repin
Friday, November 24, 2023 17:23:31

Sorry for my terrible english...


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-24 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 23:25 Set localisation locale of Windows netstat? Cedric Blancher
2023-11-23 15:36 ` Corinna Vinschen
2023-11-24 14:41 ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).