public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Erwin Waterlander <waterlan@xs4all.nl>
To: cygwin@cygwin.com
Subject: Re: cygwin started speaking German today
Date: Wed, 05 Oct 2011 16:04:00 -0000	[thread overview]
Message-ID: <4E8C7FFB.6060707@xs4all.nl> (raw)
In-Reply-To: <20111004182042.GA22299@calimero.vinschen.de>

Op 4-10-2011 20:20, Corinna Vinschen schreef:
> On Oct  4 20:03, Erwin Waterlander wrote:
>> Corinna Vinschen schreef, Op 4-10-2011 16:29:
>>> Does it? Even if I'm running a german OS, I absolutely hate to see
>>> german diagnostic output from gcc, and I absolutely hate certain
>>> programs using non-ASCII chars in output. (In)famous examples are
>>> Unicode quoting chars rather than ' or ", or using the Unicode
>>> hyphen character rather than -. But that's just me.
>> You got used to ASCII, like all the old-timers... ;)
>> export LANG=C is your solution.
>>
>> By the way, I noticed that with the default locale C.UTF-8 the
>> nl_langinfo(CODESET) C function<langinfo.h>  returns wrongly
>> "ISO-8859-1",
> Not for me:
>
>    $ cat>  setl.c<<EOF
>    #include<stdio.h>
>    #include<locale.h>
>    #include<langinfo.h>
>
>    int main(int argc, char **argv)
>    {
>      char *loc;
>      if (argc>  1)
>        loc = setlocale (LC_ALL, argv[1]);
>      else
>        loc = setlocale (LC_CTYPE, NULL);
>      printf ("locale: %s charset: %s\n", loc, nl_langinfo (CODESET));
>      return 0;
>    }
>    EOF
>    $ gcc -o setl setl.c
>    $ ./setl
>    locale: C charset: ANSI_X3.4-1968
>    $ ./setl C
>    locale: C charset: ANSI_X3.4-1968
>    $ ./setl C.utf8
>    locale: C.utf8 charset: UTF-8
>    $ ./setl C.UTF-8
>    locale: C.UTF-8 charset: UTF-8
>
>
> Corinna
>
Hi,

My program (wcd) uses gettext/libintl. Libintl is causing the effect. 
Libintl is not working properly with a locale C.UTF-8. That is a serious 
problem.

#include <stdio.h>
#include <locale.h>
#include <langinfo.h>
#include <libintl.h>

   int main(int argc, char **argv)
   {
     char *loc;
     if (argc > 1)
       loc = setlocale (LC_ALL, argv[1]);
     else
       loc = setlocale (LC_CTYPE, "");
      bindtextdomain("setl","/usr/share/locale");
      textdomain("setl");
     printf ("locale: %s charset: %s\n", loc, nl_langinfo (CODESET));
     return 0;
   }

waterlan@erwin2 ~/tmp
$ gcc -o setl setl.c -lintl

waterlan@erwin2 ~/tmp
$ echo $LANG
C.UTF-8

waterlan@erwin2 ~/tmp
$ ./setl
locale: en_US charset: ISO-8859-1

waterlan@erwin2 ~/tmp
$ locale
LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=

waterlan@erwin2 ~/tmp
$ export LANG=nl_NL.UTF-8

waterlan@erwin2 ~/tmp
$ ./setl
locale: nl_NL.UTF-8 charset: UTF-8

waterlan@erwin2 ~/tmp
$ locale
LANG=nl_NL.UTF-8
LC_CTYPE="nl_NL.UTF-8"
LC_NUMERIC="nl_NL.UTF-8"
LC_TIME="nl_NL.UTF-8"
LC_COLLATE="nl_NL.UTF-8"
LC_MONETARY="nl_NL.UTF-8"
LC_MESSAGES="nl_NL.UTF-8"
LC_ALL=


-- 
Erwin Waterlander    waterlan@xs4all.nl
Zeelsterstraat 59B,  5652 EB  Eindhoven,  The Netherlands
www: http://www.xs4all.nl/~waterlan/


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

  reply	other threads:[~2011-10-05 16:04 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-30 10:18 Voelker, Bernhard
2011-08-30 11:28 ` Charles Wilson
2011-09-08  2:31 ` Charles Wilson
2011-09-08 10:46   ` Bruno Haible
2011-09-08 10:55     ` Voelker, Bernhard
2011-09-08 11:06     ` Eric Blake
2011-09-08 12:05     ` Charles Wilson
2011-09-08 12:48       ` Andy Koppe
2011-09-08 13:13         ` Eric Blake
2011-09-08 12:51       ` Andy Koppe
2011-09-08 21:58         ` Bruno Haible
     [not found]       ` <201109082344.55506.bruno@clisp.org>
2011-09-09  9:18         ` Charles Wilson
2011-09-09 12:33           ` Andy Koppe
2011-09-09 15:00             ` Corinna Vinschen
2011-09-10 11:36               ` Thorsten Kampe
2011-09-13 18:39               ` Eric Blake
2011-09-17 21:50                 ` David Sastre
2011-09-17 22:50                   ` Ken Brown
2011-09-18  3:19                     ` David Sastre
2011-10-04 12:29                 ` Corinna Vinschen
2011-10-04 12:46                   ` Charles Wilson
2011-10-04 14:30                     ` Corinna Vinschen
2011-10-04 18:04                       ` Erwin Waterlander
2011-10-04 18:21                         ` Corinna Vinschen
2011-10-05 16:04                           ` Erwin Waterlander [this message]
2011-10-05 16:28                             ` Corinna Vinschen
2011-10-05 16:52                               ` Erwin Waterlander
2011-10-05 17:32                               ` Charles Wilson
2011-10-05 18:24                                 ` Ken Brown
2011-10-05 18:29                                   ` Corinna Vinschen
2011-10-05 18:44                                   ` Erwin Waterlander
2011-10-05 18:50                                   ` Yaakov (Cygwin/X)
2011-10-05 18:58                                     ` Christopher Faylor
2011-10-10 17:24                                   ` Corinna Vinschen
2011-10-11 15:41                                     ` Erwin Waterlander
2011-10-11 16:54                                     ` Charles Wilson
2011-10-11 17:29                                       ` Christopher Faylor
2011-10-16 18:42                                       ` Charles Wilson
2011-10-17  6:59                                         ` Corinna Vinschen
2011-10-17 13:17                                           ` Charles Wilson
2011-10-17 13:52                                             ` Corinna Vinschen
2011-10-17 13:58                                               ` Corinna Vinschen
2011-10-05 18:29                                 ` Corinna Vinschen
2011-10-06  1:35                       ` [OT] " Andrey Repin
2011-10-05 12:08                     ` Ken Brown
2011-09-09 15:13             ` Charles Wilson
2011-09-09 20:08               ` Andy Koppe
2011-09-08 13:45     ` Corinna Vinschen
2011-09-08 13:51     ` Corinna Vinschen
2011-09-08 20:57       ` Bruno Haible
2011-09-09 15:09         ` Corinna Vinschen
2011-09-09 15:58           ` Andy Koppe
2011-09-10 11:45           ` Thorsten Kampe
2011-09-10 13:50             ` Christopher Faylor
2011-09-10 16:10               ` Thorsten Kampe
2011-09-10 17:11                 ` Christopher Faylor
2011-08-31  8:39 Voelker, Bernhard
2011-08-31 14:01 ` Charles Wilson
2011-08-31 15:19   ` Charles Wilson
2011-09-01  5:30 Voelker, Bernhard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E8C7FFB.6060707@xs4all.nl \
    --to=waterlan@xs4all.nl \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).