public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Subject: Re: setting character set in mintty
@ 2014-07-08 15:32 Pawel Jasinski
  2014-07-08 18:05 ` Andrey Repin
  0 siblings, 1 reply; 3+ messages in thread
From: Pawel Jasinski @ 2014-07-08 15:32 UTC (permalink / raw)
  To: cygwin

>> The way I understand it, mintty sets the LANG variable according to
>> user settings.
>> Would it make sense for mintty to invoke "cmd /c chcp <selected>"
>> (SetConsoleOutputCP)?

>mintty does not use the console at all.  A chcp call doesn't make
>any sense.

Sorry for asking stupid question. My knowledge of cygwin internals lacks.
However, I can see that for every mintty window (and bash) I get a
conhost process running. I assume that it is where the character
setting is stored for non-cygwin processes started from bash.
Again, it is my naive believe, that somewhere there maybe a convenient
place to call SetConsoleOutputCP with argument matching content of the
LANG environment variable.


--pawel

--
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

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

* setting character set in mintty
  2014-07-08 15:32 Subject: Re: setting character set in mintty Pawel Jasinski
@ 2014-07-08 18:05 ` Andrey Repin
  2014-07-09 16:05   ` Pawel Jasinski
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Repin @ 2014-07-08 18:05 UTC (permalink / raw)
  To: Pawel Jasinski, cygwin

Greetings, Pawel Jasinski!

>>> The way I understand it, mintty sets the LANG variable according to
>>> user settings.
>>> Would it make sense for mintty to invoke "cmd /c chcp <selected>"
>>> (SetConsoleOutputCP)?

>>mintty does not use the console at all.  A chcp call doesn't make
>>any sense.

> Sorry for asking stupid question. My knowledge of cygwin internals lacks.
> However, I can see that for every mintty window (and bash) I get a
> conhost process running. I assume that it is where the character
> setting is stored for non-cygwin processes started from bash.
> Again, it is my naive believe, that somewhere there maybe a convenient
> place to call SetConsoleOutputCP with argument matching content of the
> LANG environment variable.

Even if you do that, it won't help anything at all. Typical windows program
does not expect a change in console code page at all.
If it was designed to use OEM CP, it will output in it regardless of actual
CP.

P.S.
Please teach your mail agent to insert proper threading headers. A thread
scattered across multiple pieces is very hard to follow.
If you're subscribed in digest mode, reply to your own messages sent to the
list.


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 08.07.2014, <21:49>

Sorry for my terrible english...


--
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

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

* Re: setting character set in mintty
  2014-07-08 18:05 ` Andrey Repin
@ 2014-07-09 16:05   ` Pawel Jasinski
  0 siblings, 0 replies; 3+ messages in thread
From: Pawel Jasinski @ 2014-07-09 16:05 UTC (permalink / raw)
  To: cygwin

On Tue, Jul 8, 2014 at 8:00 PM, Andrey Repin <anrdaemon@yandex.ru> wrote:
> Greetings, Pawel Jasinski!
>
>>>> The way I understand it, mintty sets the LANG variable according to
>>>> user settings.
>>>> Would it make sense for mintty to invoke "cmd /c chcp <selected>"
>>>> (SetConsoleOutputCP)?
>
>>>mintty does not use the console at all.  A chcp call doesn't make
>>>any sense.
>
>> Sorry for asking stupid question. My knowledge of cygwin internals lacks.
>> However, I can see that for every mintty window (and bash) I get a
>> conhost process running. I assume that it is where the character
>> setting is stored for non-cygwin processes started from bash.
>> Again, it is my naive believe, that somewhere there maybe a convenient
>> place to call SetConsoleOutputCP with argument matching content of the
>> LANG environment variable.
>
> Even if you do that, it won't help anything at all.

At the moment I am using ugly 'cmd /c chcp 65001' and it does help.
BTW. this is a solution recommended by cygwin FAQ. I guess I am not
the first one who encounter this inconvenience.

> Typical windows program
> does not expect a change in console code page at all.
> If it was designed to use OEM CP, it will output in it regardless of actual
> CP.


To be specific, IronPython and cpython interpreters are program which
respect CP settings.
Any .net based console application is by default respecting CP settings.
The minimalistic example of such a program:

using System;
namespace encoding_console {
    class Program {
        static void Main(string[] args) {
            Console.WriteLine("\u2192");
        }
    }
}


>
> P.S.
> Please teach your mail agent to insert proper threading headers. A thread
> scattered across multiple pieces is very hard to follow.
> If you're subscribed in digest mode, reply to your own messages sent to the
> list.

This is the case. I didn't realized I was messing something up by
editing things by hand. Sorry.

>
>
> --
> WBR,
> Andrey Repin (anrdaemon@yandex.ru) 08.07.2014, <21:49>
>
> Sorry for my terrible english...
>

--
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

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

end of thread, other threads:[~2014-07-09 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08 15:32 Subject: Re: setting character set in mintty Pawel Jasinski
2014-07-08 18:05 ` Andrey Repin
2014-07-09 16:05   ` Pawel Jasinski

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).