Dan Kegel wrote:
- multiline strings from resource file are displayed with extra newline
between lines in wine, but not in windows. To reproduce, build either as winelib app or build under MSVC6, then run in wine; usage message comes out double-spaced. Help!
Unfortunately, if I do STRING_FOO, "This is a two-line \ string" it looks good in Wine, but it's run together on one line in Windows. Conversely, if I do STRING_FOO, "This is a two-line \n \ string" it looks good in Windows, but it's double-spaced in Wine.
Something's fishy here. Our .rc files should be usable in both environments without change.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/rc_49... says that \ is a simple line-continuation character. Thus \ at the end of a line in the .rc file should not insert a newline in the resource, I think. And it looks like our resource compiler is violating this. Compiling the stringtable entry
1, "xx\ yy"
yields different results with our compiler and the one in vc6:
$ tools/wrc/wrc rsrc.rc -o x.res
$ hexdump -C x.res 00000000 00 00 00 00 20 00 00 00 ff ff 00 00 ff ff 00 00 |.... ...........| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 2a 00 00 00 20 00 00 00 ff ff 06 00 ff ff 07 00 |*... ...........| 00000030 00 00 00 00 00 10 09 04 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 05 00 78 00 78 00 |............x.x.| 00000050 0a 00 79 00 79 00 00 00 00 00 00 00 00 00 00 00 |..y.y...........| 00000060 00 00 00 00 00 00 00 00 00 00 00 00 |............| 0000006c
$ wine /dos/c/Program\ Files/Microsoft\ Visual\ Studio/Common/MSDev98/bin/rc.exe /r /fo y.res rsrc.rc
$ hexdump -C y.res 00000000 00 00 00 00 20 00 00 00 ff ff 00 00 ff ff 00 00 |.... ...........| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 28 00 00 00 20 00 00 00 ff ff 06 00 ff ff 07 00 |(... ...........| 00000030 00 00 00 00 30 10 09 04 00 00 00 00 00 00 00 00 |....0...........| 00000040 00 00 00 00 00 00 00 00 00 00 04 00 78 00 78 00 |............x.x.| 00000050 79 00 79 00 00 00 00 00 00 00 00 00 00 00 00 00 |y.y.............| 00000060 00 00 00 00 00 00 00 00 |........|
After squinting at our source, I came up with a one-line patch to fix our resource compiler (attached). If that looks good, I can do a patch that fixes up all our .rc files that expected backslash to behave in a nonstandard way. - Dan