Skip to content
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

Unicode problem #93

Open
wants to merge 1 commit into
base: node-gyp-3
Choose a base branch
from

Conversation

digital-flowers
Copy link

when compile any node addon with USE_WCHAR and UNICODE flags it works will in node-gyp module but it fails in nw-gyp and this a quick workaround to fix this problem

when compile any node addon with USE_WCHAR and UNICODE flags it works will in node-gyp module but it fails in nw-gyp and this a quick workaround to fix this problem
@DuBistKomisch
Copy link

I ran into the same problem. A simpler solution is to explicitly use GetModuleHandleA, i.e. the non-wchar/unicode version.

@digital-flowers
Copy link
Author

@DuBistKomisch i have no experience that much in cpp but this is how i solved it but now it is the turn of experts like you ;)

@robert-j
Copy link

robert-j commented Jun 9, 2020

Windows has macros for this situation:

node_dll = GetModuleHandle(TEXT("node.dll"));

You just have to use the TEXT macro to wrap string literals. The macro expands to L"node.dll"
for UNICODE and "node.dll" for single byte builds.

GetModuleHandle is already a macro that expands to the A or W version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants