delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/04/10:07:42

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
From: "Joseph Quinsey" <jquinsey AT entrenet DOT com>
To: <cygwin AT cygwin DOT com>
References:
Subject: RE: Cygwin 1.7.1 sprintf() with format string having 8th bit set
Date: Mon, 4 Jan 2010 10:07:44 -0500
Message-ID: <6E7EF003DE3743959BC8EC8F0A6872AA@LeakyCauldron>
MIME-Version: 1.0
In-Reply-To:
X-Declude-Sender: jquinsey AT entrenet DOT com [199.246.24.8]
X-Declude-Spoolname: D04160199000052e8.smd
X-Declude-RefID: str=0001.0A090205.4B420412.012F,ss=1,fgs=0
X-Declude-Note: Scanned by Declude 4.6.35 "http://www.declude.com/x-note.htm"
X-Declude-Scan: Outgoing Score [-3] at 10:07:38 on 04 Jan 2010
X-Declude-Tests: SENDERSCORE [7], NOPOSTMASTER [1], SPFPASS [-2], FILTER-SUBJECT [2], FILTER_COUNTRY [0], FILTER-NO-RBL-VIA-RELAY [-7], ZEROHOUR [0]
X-Country-Chain: CANADA->destination
X-Declude-Code: e
X-Declude-Recipcount: 1
X-Helo: relay.thehostingservice.com
X-RevDNS: relay.thehostingservice.com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hello,

Thank you Andy for your help. As per your suggestion, the problem was
resolved by adding the line:

    setlocale (LC_CTYPE, "C.ASCII");

My actual code was something like:

    #define CSI_ "\233"
    ...
    sprintf (..., CSI_"%d;%dH", row, col);

So my problem is fixed. 

But as a matter of general interest, there are still some oddities:

1) In my bad test, I already had my LOCALE set to C.ASCII:

   env | grep LC
   LC_ALL=C.ASCII

I'm using tcsh(1), if this matters. And this setting generates a nuisance
message "locale not supported by Xlib, locale set to C" whenever I start
nedit. And $LANG is ASCII, if this matters.
   
2) The call setlocale (LC_CTYPE, "C") did not work, although it returns its
second argument.

3) The call setlocale (LC_CTYPE, "POSIX") also did not work. It happens to
return "C".

The above behaviour seems to disagree with the man page.

Thank you again for your very prompt help.

Regards, Joe Quinsey


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019