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

Does not compile in Windows in Unicode (WCHAR) mode #170

Open
rpatters1 opened this issue Oct 27, 2023 · 2 comments
Open

Does not compile in Windows in Unicode (WCHAR) mode #170

rpatters1 opened this issue Oct 27, 2023 · 2 comments

Comments

@rpatters1
Copy link
Contributor

It is easy enough to fix by appending "A" to the affected functions:

  • CreateFileA
  • GetFinalPathNameByHandleA
  • CreateHardLinkA
  • CreateSymbolicLinkA
  • GetFileAttributesExA

However, it really depends on what the goal of the repo is. A more appropriate approach might be to convert all the relevant strings to WCHAR and call the W versions. This would require changing the inputs from ANSI to UTF8.

@cuavas
Copy link
Contributor

cuavas commented Oct 27, 2024

See discussion on #57 – changing the lfs API to use UTF-8 would make it incompatible with built-in Lua functionality. For example you wouldn’t be able to pass a file name from an lfs directory listing to io.open.

@rpatters1
Copy link
Contributor Author

rpatters1 commented Oct 27, 2024

If you change the Window API calls to explicitly use the A functions, then the project will build in either MultiByte or Unicode modes but continue to function the same. (That is, it will continue to be compatible with io.open.)

Windows itself now has a UTF8 option for ANSI. I would hope it will gradually move everyone in that direction. That will allow all 8-bit char functions (including Lua's) to run with utf8.

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

No branches or pull requests

2 participants