public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Quotes changed to odd characters in gcc error msgs
@ 2016-01-13 15:41 Chuck Roberts
  2016-01-13 19:52 ` Ken Brown
  2016-01-13 20:48 ` Warren Young
  0 siblings, 2 replies; 4+ messages in thread
From: Chuck Roberts @ 2016-01-13 15:41 UTC (permalink / raw)
  To: cygwin

Hello,
I am running Cygwin 2.3.0 on Windows 7. I'm new to Cygwin and trying to
learn C programming (basic ANSI C).

I'm having 2 problems.

1) When I get an error message from the gcc compiler, the quotes in the
message are turned to high ascii characters that don't make sense. How do
I fix this? My TERM variable says "cygwin".

2) I'm using PSPad to edit some of my .C files. Since I've started using
PSPad, the directory listing of files using 'ls -l' has the occasional
file concatenated with the next file, like a carriage return is missing
somewhere. I am using colors, and load .dircolors in my .bashrc each time
I start Cygwin. Here is what I added to the bottom of my .bashrc:

function funclm
{
# Use --grou-directories-first
ls -hlF --color $@|more
}
function funcls
{
ls -hF --color $@|more
}

alias envm='env|sort|less'
alias findit='echo See locate'
alias h='history'
alias lf='funclf'
alias lm='funclm'
alias ls='funcls'
alias mv='mv -v'
alias perltext='perldoc -t -T'
alias src='source $HOME/.bashrc'

export EDITOR=nedit

# Stuff for X windows and nedit.
DISPLAY=10.19.251.67:0.0; export DISPLAY
export PAGER=/usr/bin/less

# Misc stuff
export PATH=./:$PATH
eval `dircolors -b $HOME/.dircolors`

Thank you.
Chuck

--
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] 4+ messages in thread

* Re: Quotes changed to odd characters in gcc error msgs
  2016-01-13 15:41 Quotes changed to odd characters in gcc error msgs Chuck Roberts
@ 2016-01-13 19:52 ` Ken Brown
       [not found]   ` <277b7d7a165db5eb69855d1ce25cb6d6@mail.gmail.com>
  2016-01-13 20:48 ` Warren Young
  1 sibling, 1 reply; 4+ messages in thread
From: Ken Brown @ 2016-01-13 19:52 UTC (permalink / raw)
  To: cygwin

On 1/13/2016 10:05 AM, Chuck Roberts wrote:
> Hello,
> I am running Cygwin 2.3.0 on Windows 7. I'm new to Cygwin and trying to
> learn C programming (basic ANSI C).
>
> I'm having 2 problems.
>
> 1) When I get an error message from the gcc compiler, the quotes in the
> message are turned to high ascii characters that don't make sense. How do
> I fix this? My TERM variable says "cygwin".

These are probably Unicode curly quotes.  They should display properly 
if you use one of the standard Cygwin terminals (such as mintty or xterm).

Ken

--
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] 4+ messages in thread

* Re: Quotes changed to odd characters in gcc error msgs
  2016-01-13 15:41 Quotes changed to odd characters in gcc error msgs Chuck Roberts
  2016-01-13 19:52 ` Ken Brown
@ 2016-01-13 20:48 ` Warren Young
  1 sibling, 0 replies; 4+ messages in thread
From: Warren Young @ 2016-01-13 20:48 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Jan 13, 2016, at 8:05 AM, Chuck Roberts <croberts@gilsongraphics.com> wrote:
> 
> My TERM variable says "cygwin”.

That means you’re running under the built-in Windows console, not MinTTY, which means you don’t get UTF-8 support by default.

You could try “chcp 65001” but the real fix is to use MinTTY.  MinTTY has *many* features not available in the Windows Console.  Even the vastly upgraded version included with Windows 10 is a pale wannabe compared to MinTTY.  man mintty for details.

> 2) I'm using PSPad to edit some of my .C files.

Careful, there.  Unix is traditionally case-sensitive, and some programs coming from that tradition treat .C files differently from .c files.  One such tool is gcc, which will interpret your file as C++ even if you invoke it as gcc instead of g++.

GNU make also assumes .C is C++.

C++ is not 100% forwards compatible with C:

  https://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B

On Windows, NTFS is case-insensitive by default, but also case-preserving, so saving a file as *.C will invoke this automatic C++ treatment under Cygwin.

> the directory listing of files using 'ls -l' has the occasional
> file concatenated with the next file, like a carriage return is missing
> somewhere.

This may be a Windows Console bug, too.  Again, switch to MinTTY.  It’s the default for a reason.
--
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] 4+ messages in thread

* Re: Quotes changed to odd characters in gcc error msgs
       [not found]   ` <277b7d7a165db5eb69855d1ce25cb6d6@mail.gmail.com>
@ 2016-01-13 21:20     ` Ken Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Ken Brown @ 2016-01-13 21:20 UTC (permalink / raw)
  To: cygwin

[Let's keep the discussion on the mailing list.]

On 1/13/2016 11:28 AM, Chuck Roberts wrote:
> -----Original Message-----
> From Ken Brown
> On 1/13/2016 10:05 AM, Chuck Roberts wrote:
>> Hello,
>> I am running Cygwin 2.3.0 on Windows 7. I'm new to Cygwin and trying
>> to learn C programming (basic ANSI C).
>>
>> I'm having 2 problems.
>>
>> 1) When I get an error message from the gcc compiler, the quotes in
>> the message are turned to high ascii characters that don't make sense.
>> How do I fix this? My TERM variable says "cygwin".
>
> These are probably Unicode curly quotes.  They should display properly if
> you use one of the standard Cygwin terminals (such as mintty or xterm).
>
> Ken
>
> Got it! I did this then added these commands to my .bashrc:
> export TERM=mintty
> export LANG=en_US

Bad idea.  mintty sets TERM to the appropriate value (which happens to 
be xterm).  And you probably want LANG to be en_US.UTF-8; but you don't 
have to set it yourself.  It's done by the script 
/etc/profile.d/lang.sh, which is run by /etc/profile.

Ken


--
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] 4+ messages in thread

end of thread, other threads:[~2016-01-13 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13 15:41 Quotes changed to odd characters in gcc error msgs Chuck Roberts
2016-01-13 19:52 ` Ken Brown
     [not found]   ` <277b7d7a165db5eb69855d1ce25cb6d6@mail.gmail.com>
2016-01-13 21:20     ` Ken Brown
2016-01-13 20:48 ` Warren Young

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