Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UTF-8 handling of config file name
If we're going to convert the filename *from* UTF-8 when opening it, then we really ought to be convert it *to* UTF-8 first. This would have shown up if invoking openconnect in a non-UTF-8 locale, with a non-ASCII filename. On POSIX systems this whole thing is a no-op, since converting from any arbitrary 8-bit charset to UTF-8 and back again effectively does nothing. However, on Windows the convert_arg_to_utf8() function doesn't just work on the input string; it looks aside with GetCommandLineW() to find the *original* text on the command line, and uses that instead. So we really do have to do the double "conversion" — even when it's simply converting to UTF-8, *immediately* converting back again (in fopen_utf8()), and *never* using it again. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
- Loading branch information