bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Patch: Fix printing mutibyte characters as unprintable ch


From: Eli Zaretskii
Subject: Re: [Bug-wget] Patch: Fix printing mutibyte characters as unprintable characters on Windows
Date: 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 :)

Thanks.

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:

  static void
  i18n_initialize (void)
  {
    /* ENABLE_NLS implies existence of functions invoked here.  */
  #ifdef ENABLE_NLS
    /* Set the current locale.  */
    setlocale (LC_ALL, "");
    /* Set the text message domain.  */
    bindtextdomain ("wget", LOCALEDIR);
    textdomain ("wget");
  #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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]