-
Notifications
You must be signed in to change notification settings - Fork 239
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
Utf-8/unicode support in legacy tools and lib. #800
Conversation
Removes unnecessary fmt headers from platform_utils.
for better compatibility with the CTS framework. Handle unlinking of unicode-named files in ktxsc.
Fix handling in ktxsc.
@aqnuep I want to remove the Thank you so much @aqnuep for the clean method you made to handle unicode file names on Windows. It is so much nicer than having generic text macros everywhere. I have completely removed those macros from everywhere. I'll await your thoughts before pushing a commit or not. |
for Linux. This is so CTS framework can run tests on legacy tools and is a necessary part of fixing #796.
The reason I left those in is to avoid any existing users of any subset of the repository components with |
Thank you for your review, @aqnuep. Since building with _UNICODE leads to build errors, and always has, we will not be breaking any user code by removing it. With all generic text stuff removed defining _UNICODE will not affect the compiled code so I don't think an error is necessary. Perhaps a warning that is has no effect. |
I'm just unsure whether that's the case with all combinations of the configuration parameters, but if you're confident about this and do not see any risk with removing support for it, we could, and then we should add an explicit configure-time error when |
I don't understand exactly what your concern is. There are 3 ways I see that _UNICODE could be enabled:
I don't think we should be concerned about 1 & 2. For 3, my only concern would be an app being compiled with _UNICODE defined that calls one of the Currently if _UNICODE is defined compilation of the tools and loadtest apps will fail. Gtest-based tests and library compilation will succeed since they contain no generic text macros. This is independent of configuration parameters. The one thing I think we should fix here, with or without removal of generic text macro use, is to fix
and in initUTF8CLI
Note that currently compile of platform_utils.h will fail if _UNICODE is defined as ktxtools apps will expect argv[] to be a char* but it will be a wchat_t*. |
My only concern is (2) in your list, e.g. they Then again, it's just a general backward compatibility concern, and considering that such users can always just use an older version of the code considering that this was never officially supported and/or functional in practice. So if you're fine with removing support for |
Regarding Windows UWP support, that should be a separate effort IMO. We should first confirm whether it really is a must to support |
Okay. I'll add the commit that removes all generic text usage.
I agree. I got carried away. I researched the UWP situation to see if lack of _UNICODE would be an issue. It isn't. It is only relevant to software using the generic text macros to support unicode. Since we aren't, it doesn't apply. The main point is that the command line arguments are only available to UWP apps as wchar_t*. With that knowledge I thought about the changes needed to support UWP in our code and wrote it up. I realized after the fact that there is an error in my sample code. |
I think we should get a UWP build on CI, if we'd like to tackle this, but in the end the main entry point's signature wouldn't even matter if we'd use the same wchar APIs directly to fetch the UTF-16 parameters manually and convert them to UTF-8. |
Remove all generic text macros. Fixes KhronosGroup#764. The *NamedFile* functions now accept full utf8 filenames on any platform. Windows applications must use WideCharToMultiByte to convert unicode filenames before calling these functions.
Remove all generic text macros. Fixes KhronosGroup#764. The *NamedFile* functions now accept full utf8 filenames on any platform. Windows applications must use WideCharToMultiByte to convert unicode filenames before calling these functions.
Remove all generic text macros. Fixes KhronosGroup#764. The *NamedFile* functions now accept full utf8 filenames on any platform. Windows applications must use WideCharToMultiByte to convert unicode filenames before calling these functions.
Remove all generic text macros. Fixes KhronosGroup#764. The *NamedFile* functions now accept full utf8 filenames on any platform. Windows applications must use WideCharToMultiByte to convert unicode filenames before calling these functions.
Remove all generic text macros. Fixes KhronosGroup#764. The *NamedFile* functions now accept full utf8 filenames on any platform. Windows applications must use WideCharToMultiByte to convert unicode filenames before calling these functions.
Fixes #764.