BenjaminRi / winresource

Create and set windows icons and metadata for executables with a rust build script
MIT License
50 stars 10 forks source link

Support for `'` in FileDescription #19

Open UnexomWid opened 6 months ago

UnexomWid commented 6 months ago

Hello and thanks for the crate!

If the package description contains the ' character, it will show up as \' in the file properties when compiling with rc.exe.

Example:

[package]
description = "SomeUser's FooBar Project"

This generates the following:

VALUE "FileDescription", "SomeUser\'s FooBar Project"

All good so far. I expected Microsoft's resource compiler to escape it, since it's a valid C escape sequence.

However, it doesn't seem to do so, and it just inserts \' as-is, making the description in the properties:

SomeUser\'s FooBar Project

I also tried running rc.exe manually on the resource file, and it led to the same result. Seems like it's rc.exe's fault.

Removing this line will get rid of the escape, and will generate "SomeUser's FooBar Project". The compiler seems to have no issue with that and works properly.

Not sure if removing the escape sequence for ' will impact something else, but my guess is that it won't.

I can create a PR with this fix if it's all good.