MultiByteToWideChar
and WideCharToMultiByte
.
-1
, as this will assume null-termination and also ensure it for the output
str_format
in fs_storage_path
instead of platform specific functions for better maintainability.
fs_is_dir
smarter by using GetFileAttributesW
on Windows.
cmdline_init
, cmdline_arg_num
, cmdline_arg_get
and cmdline_free
functions to handle command line arguments in utf8 on windows.
The original argc
and argv
need to be passed to cmdline_init
in the beginning and are stored in global variables for non-Windows systems.
On windows the API functions are used to retrieve the arguments as a wide string, but if CommandLineToArgvW
fails, it will fall back to the original argv
string.
The wide string is then retrieved in utf8 via...