X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.0 required=5.0	tests=BAYES_40,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
X-Host-mx2: True
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Subject: 1.5.24-2  Problem with cpp and mixed unicode/ansi source files
Date: Fri, 30 Apr 2010 08:57:10 -0400
Message-ID: <8F37BF6F420455468C4BD57DD6BE199005907924@cobra.pc.cognex.com>
From: "Davis, Jason" <Jason.Davis@cognex.com>
To: <cygwin@cygwin.com>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

We use cygwin's cpp.exe (gcc, I guess) to pre-process .rc files before they=
 get converted into compiled resource files.  In our source tree there's a =
file foo.rc, which is 8-bit ansi, which declares some stuff and then has th=
e following lines:

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "afxres.rc"         // Standard components
#include "afxprint.rc"       // printing/print preview resources
#endif

Those two #includes are files shipped with the Visual Studio Windows SDK.

Now this worked fine under Visual C 6/7/8/9.  However, under VC10, suddenly=
 those Microsoft include files are unicode.  (Note: not an issue with unico=
de file names.. these have 8-bit file names and unicode contents).  Now whe=
n the afxres.rc and afxprint.rc files are included, the contents are insert=
ed exactly as-is into the output stream, rather than interpreted.  So the o=
utput file looks normal for a while, and then suddenly there's a bunch of b=
ox-char-box-char-etc with the (formerly unicode) contents of the afxres.rc =
file, then the same for afxprint.rc, and then some normal output again.

As a test, I changed foo.rc itself to be a unicode text file, and then its =
contents were similarly copied into the result file.

I found http://cygwin.com/cygwin-ug-net/setup-locale.html , but I'm not sur=
e that's my issue, really.

I don't know if this issue can be solved with a unicode code_page, or an up=
grade to a newer version of cygwin, or a command-line switch to the executa=
ble, or just I'm out of luck.

Can anyone shed some light on my problem?  My apologies if this is the wron=
g mailing list for this question.  Thank you.

Jason Davis

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

