[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Patch: Fix printing mutibyte characters as unprintable ch
Re: [Bug-wget] Patch: Fix printing mutibyte characters as unprintable characters on Windows
Thu, 02 Nov 2017 18:14:57 +0200
> From: "YX Hao" <address@hidden>
> Date: Thu, 2 Nov 2017 21:09:31 +0800
> During my daily use, I've found a few small bugs and made the patches.
> I will email them in standalone topics. Patch is attached.
> I made the patch on Windows. I think it shouldn't break anything on other
> platforms. Please take a review :)
I'm not Tim, but I have a few questions about your patches.
> 1. setlocale
Can you explain why you needed this? wget already calls setlocale:
/* ENABLE_NLS implies existence of functions invoked here. */
/* Set the current locale. */
setlocale (LC_ALL, "");
/* Set the text message domain. */
bindtextdomain ("wget", LOCALEDIR);
#endif /* ENABLE_NLS */
Your change calls setlocale with a different value, does that even
when ENABLE_NLS is not defined, and also runs the risk of using a
wrong codepage, if _getmbcp returns zero (as MSDN says it could). Why
is that needed?
> +#ifdef WINDOWS
> + CP = _getmbcp(); /* Consider it's different from default. */
Why would it be different from default, and if it is, why doesn't the
call to setlocale shown above do its job?