Skip to content

Commit 692a623

Browse files
committed
fixup! Windows native IDN
1 parent aa5b5c7 commit 692a623

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/msmtp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3763,7 +3763,7 @@ void msmtp_print_conf(msmtp_cmdline_conf_t conf, account_t *account)
37633763

37643764
int main(int argc, char *argv[])
37653765
{
3766-
#if defined(W32_NATIVE) && !defined(_UNICODE) && !defined(HAVE_LIBIDN)// && !defined(ENABLE_NLS)
3766+
#if defined(W32_NATIVE) && !defined(_UNICODE) && !defined(HAVE_LIBIDN) && !defined(ENABLE_NLS)
37673767
/* We need this for proper IDN conversion later on using Windows native way
37683768
* AND proper console output.
37693769
* > At program startup, the equivalent of the following statement is executed :

src/net.c

+2
Original file line numberDiff line numberDiff line change
@@ -765,12 +765,14 @@ int net_open_socket(
765765
/* FIXME: Something messes up locale (at least on MSYS2/UCRT64) and setlocale(LC_ALL, "") won't fix it.
766766
* The commented code below is the way to get proper console output for hostname.
767767
* Otherwise let's make sure we get proper IDN conversion and that is it. */
768+
/*
768769
char locale_name[LOCALE_NAME_MAX_LENGTH * sizeof(WCHAR)];
769770
GetSystemDefaultLocaleName((LPWSTR)locale_name, LOCALE_NAME_MAX_LENGTH);
770771
size_t len = wcsnlen_s((LPWSTR)locale_name, LOCALE_NAME_MAX_LENGTH);
771772
for (int i = 1; i <= len; ++i)
772773
locale_name[i] = locale_name[i * 2];
773774
setlocale(LC_ALL, locale_name);
775+
*/
774776
_locale_t locale = _create_locale(LC_ALL, "");
775777
errno_t err = _mbstowcs_s_l(&conv, hostname_wide, ARRAYSIZE(hostname_wide), hostname, _TRUNCATE, locale);
776778
_free_locale(locale);

0 commit comments

Comments
 (0)