-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom preprocessor #5
Comments
Some notes on potential UTF-16 handling I had locally that are relevant:
Need to ensure that the generated #pragma code_page lines aren't ignored due to them being part of an included file
Also need to keep https://squeek502.github.io/resinator/windows/input-and-output-code-pages.html in mind. What |
Hi, just wanted to make a suggestion: would it be possible to simply handle the cases that are easy, and leave the more difficult ones for later? Particularly, being able to parse UTF-16 resource files that don't have any problematic |
Unfortunately, the baseline would be a C preprocessor that can handle UTF-16 encoded files as input, which is not necessarily easy on its own (for context, the Microsoft compilers are the only existing ones I'm aware of that support UTF-16 [or, at least, I know clang and gcc don't]). Beyond that, decisions need to be made about the encoding of the output of the C preprocessor, and how that interacts with the resource compiler (this is where |
I feel I'm missing something, but what about just taking converting UTF-16 files to UTF-8 and then feeding them to your C preprocessor? |
That would be one way to go, but it would be the C preprocessor that would need to do the conversion, since that's what's handling It would also need some way to let the resource compiler know how the output should be interpreted, either:
Consider this example: #pragma code_page(1252)
#include "windows1252.rc"
// no need to set code page, the UTF-16 encoding is inferred
#include "utf16.rc"
// code page 1252 is still active
#include "windows1252_again.rc" Running
This approach of (as an aside, note also that there are |
Ahh... I see. Thanks for the explanation, that's definitely annoying! |
No worries, writing this out has helped clarify my thoughts about the problem. I'm thinking this might be the most viable path to getting initial UTF-16 support:
That would allow the preprocessor to not have any |
This would be a solution for the "Unavoidable divergences from the Windows RC compiler" which are all preprocessor related.
Most notably, it would be necessary for UTF-16 support.
This would likely be a large undertaking. A starting point might be to fork arocc.
EDIT: Experimenting with this here: https://github.com/squeek502/preresinator
The text was updated successfully, but these errors were encountered: