hactool
hactool copied to clipboard
Hactool fails on user accounts with special characters
The program can't open and just says: Cannot convert "C:\Users\Čeněk" to UTF-16
Got the same problem with the "é" in "Rémi"
Still happening with latest release with "ý"
This problem is always present in the version 1.3.2.
It is because the program assumes that the paths read from %HOME%, %USERPROFILE% etc. are in UTF-8, while normally they are in your system locale. I changed the code to the following in filepath.c, not sure if it doesn't introduce any other bugs:
void os_strcpy(oschar_t *dst, const char *src) {
#ifdef _WIN32
if (src == NULL) return;
size_t srcLen = strlen(src);
int requiredSize = MultiByteToWideChar(CP_ACP,0,src,srcLen,0,0);
if (requiredSize > MAX_PATH-1) {
fprintf(stderr, "Failed to convert %s to UTF-16: required size too large!\n", src);
exit(EXIT_FAILURE);
}
int retval = MultiByteToWideChar(CP_ACP,0,src,srcLen,dst,requiredSize);
if (!retval) {
fprintf(stderr, "Failed to convert %s to UTF-16!\n", src);
exit(EXIT_FAILURE);
}
#else
strcpy(dst, src);
#endif
}
it happens to me with the _