This is the mail archive of the
mailing list for the Cygwin project.
1.5.24-2 Problem with cpp and mixed unicode/ansi source files
- From: "Davis, Jason" <Jason dot Davis at cognex dot com>
- To: <cygwin at cygwin dot com>
- Date: Fri, 30 Apr 2010 08:57:10 -0400
- Subject: 1.5.24-2 Problem with cpp and mixed unicode/ansi source files
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 the following lines:
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#include "afxres.rc" // Standard components
#include "afxprint.rc" // printing/print preview resources
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 unicode file names.. these have 8-bit file names and unicode contents). Now when the afxres.rc and afxprint.rc files are included, the contents are inserted exactly as-is into the output stream, rather than interpreted. So the output file looks normal for a while, and then suddenly there's a bunch of box-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 sure that's my issue, really.
I don't know if this issue can be solved with a unicode code_page, or an upgrade to a newer version of cygwin, or a command-line switch to the executable, or just I'm out of luck.
Can anyone shed some light on my problem? My apologies if this is the wrong mailing list for this question. Thank you.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple