3

I have a bit of a problem in cygwin,

When I use make utility in cygwin, it prints rectangles instead of text. Also when text is not english, i.e. polish or russian I see rectangles instead of characters. But when I print those symbols I see them. I'm using mintty, also XTerm, mintty is a bit better.

Output of locale from Xterm:

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

But the thing is while my windows xp is english version, I'm not in US and have Russian time and date settings, maybe it's the problem?

I want to see correctly texts in different languages, is there a way?

Also mintty and xterm behave a bit different. I have a text file in polish language and cat in mintty gives no rectangles for that text, while cat in xterm gives me rectangles for some characters.

Output for make looks like this in mintty:

$ make
make: ▒▒▒▒ `default' ▒▒ ▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒.

and like this:

$ make
make: �� `default' � ���� ����� ���.

in xterm.

I found a way to fix it for sertain languages: https://stackoverflow.com/questions/13094248/how-do-i-get-accented-letters-to-actually-work-on-bash when I set options for mintty like said there and specify character set ISO-8859-2, I can see polish text fine. Only I don't undertand, I saved text in utf-8 format, why do I need set charset, as if my text was in ANSI.

And I can only see make results (which is in russian, i don't know why) when I set charset to CP1251.

  • Does that help clear things up? – Drav Sloan Sep 11 '13 at 18:25
2

Note: I asked the OP to update his question with output to locale

It sounds like you have a locale issue, you can see what your present locale settings are with locale. You most likely have a LC_* setting that is causing make to output in a format that your terminal is not recognizing. If you have chosen a UTF8 charset, and then have a terminal that is not set to parse UTF8 strings, or support them you would see this. Also on the same terms, if you have a non-utf-8 locale and your terminal is set to display utf-8 you'd also see similar issues. Minitty supports them:

$ perl -le 'binmode(STDOUT, ":utf8"); print "\x{0e44}\x{0e45}\x{0e46}";'
ไๅๆ

Try LC_ALL=C make , or export LC_ALL=C && make and see if the block output goes away.

To answer your question of the difference in utf8 and ANSI, utf8 has a MUCH bigger character set. To address this, utf8 uses 2 bits to describe extended character sequences where character sets like ISO-8859-2 only use 1. However, unless tricks like the BOM are put in the file (which is not always supported) the programs you use have no idea in the differences, and so rely on the settings set in your locale on how to interpret these strings. To complicate these matters, not all applications support utf8. More details on the specifics of encoding, unicode and utf8 can be found on Wikipedia. If you need to encode your Russian text in unicode, the unicode sequences can be found on Wikipedia also.

If you use extended characters in your Makefile, you have to make sure they conform to the encoding you intend to run them in.

  • That's all a seems to be a bit more complicated then I expected, but really thanks for helping. – dhblah Sep 11 '13 at 18:31
  • Yep it's a bit messy, I run a purely utf-8 based environment (not in cygwin tho) and for the most part it works pretty well. – Drav Sloan Sep 11 '13 at 18:37
1

What is mintty set to use for font and locale? You can find the settings by clicking the top left of the mintty window, select 'Options...' and then click 'text'.

Mine is set to Font: Consolas, 11-point. Locale: en_US, Character set: UTF-8.

Try that first, then try setting your Locale to Russian.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.