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

Win32FileSystem releated functions should use wchar_t (UTF-16) #7

Closed
hals1010 opened this issue Mar 1, 2018 · 0 comments
Closed

Win32FileSystem releated functions should use wchar_t (UTF-16) #7

hals1010 opened this issue Mar 1, 2018 · 0 comments

Comments

@hals1010
Copy link

hals1010 commented Mar 1, 2018

File related classes like WindowsFile use ANSI functions like fopen_s. This may lead to problems if the app ever runs on computers that use Asian file names (I had to learn this the hard way).

Please consider using "wide" functions like _wfopen_s for this.

Structs like ShaderCreationAttribs (contains a member const Char* FilePath) may stay as they are, as long as the file name is UTF-8 encoded. You can later convert that to wchar_t by using

MultiByteToWideChar(CP_UTF8, 0, pcUTF8, -1, wUTF16, _countof(wUTF16);

Best Regards,
Jörn

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

No branches or pull requests

1 participant