On Nov 12, 1:58 am, br.renatosilva wrote:
> First of all, mintty is awesome, thanks. I have some small issues once in a
> while, but the one that comes to mind right now is output encoding.
>
> I leave the locale and chaset configurations empty, and it works nicely, I
> think it uses Windows-1252 or ISO-8859-1.
In that case, if a locale is set in the environment (through LC_ALL,
LC_CTYPE or LANG), mintty uses that. Otherwise, it uses the platform
default. For Cygwin 1.7, that's UTF-8, whereas for 1.5 and MSYS, it's
the system's "ANSI" codepage, which indeed is CP1252 for Western
European languages.
> However, I wanted programs with
> different encoding output working nicely too. For example, cmd.exe uses
> CP850, and unix-like programs commonly use UTF-8 (actually, I don't know
> how MSYS utilities treat encoding exactly, since I don't have a sample
> output with non-ASCII chars to show you, but either way, if MSYS ever uses
> UTF-8 somewhere, that won't work in MinTTY automatically).
MSYS and Cygwin 1.5 have very little locale/encoding support.
Basically, they assume singlebyte encodings and default to the
system's ANSI codepage. For Cygwin 1.5, there's a $CYGWIN option for
switching to the OEM codepage, which means CP850 in your case. Not
sure whether MSYS has that option too. (Cygwin 1.7 has full locale
support, supporting lots of encodings.)
> I'm thinking of a simple approach based on directories and files, for
> example:
>
> * Any program from C:\Windows is considered to output ISO-8859-1
> * Any program from C:\SomeUTF8Program is considered as UTF-8
> * Output of C:\Windows\System32\cmd.exe will be CP850
I'm afraid that's not feasible, because mintty doesn't know what
program each bit of output comes from. It's not mintty that processes
your commands, but the shell invoked inside it (usually bash).
However, you can switch the codepage used by cmd.exe and other "DOS"
programs using the 'chcp' command, e.g.:
$ /Windows/System32/chcp 1252
Active code page: 1252
> By the way, I know this should be a bug report maybe
Yep.
> but I just want to
> inform that if ~/.minttyrc is hidden, we can only read settings not save.
> It is hidden in my installation because C:/Users is mounted at /home, and I
> don't like those hidden files showing up in my profile. Not a big issue, I
> can "attrib -h ~/.minttyrc", and rollback after saving settings, but that's
> it. The error message is permission denied, not accurate but as I said
> toggling the hide flag fixes the problem.
This doesn't happen with Cygwin 1.7, so I expect it's an MSYS oddity.
Andy