This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]