logo       


Re: Strange character in file length: msg#00080

Subject: Re: Strange character in file length
Alain Bench <veronatif@xxxxxxx> writes:

> Call setlocale(LC_ALL, ".OCP") which will select the default OEM
> charset of the current Windows language. OCP means "OEM Code Page",
> and console apps by default need to use this OEM charset: Probably
> CP-852 for you, CP-850 for me, and so on. Here this setlocale .OCP
> returns "French_France.850".
>
> Another possibly better way, able to follow the current charset of
> the console (not only the default):

Is the "current charset of the console" ever really different than the
"default OEM charset"?  How does one change the console charset,
anyway?

> Call GetConsoleOutputCP(), get example 850, build a string ".850"
> with the dot, and call setlocale(LC_ALL, ".850"). Problem: Not every
> combination of language, country, and charset is possible. So deal
> with errors (setlocale returns NULL), and fallback to ".OCP".

Thanks for the detailed description.  In that case, the setlocale
invocation should look like this:

#ifdef WINDOWS
  {
    char console_code_page[32];
    snprintf (console_code_page, sizeof console_code_page,
              ".%u", GetConsoleOutputCP ());
    if (!setlocale (LC_ALL, console_code_page))
      setlocale (LC_ALL, ".OCP");
  }
#else
  setlocale (LC_ALL, "");
#endif

But I've now noticed another issue: Wget is calling setlocale(LC_ALL,
"") only if HAVE_NLS is defined, which is typically not the case on
Windows, as HAVE_NLS implies existence of gettext, textdomain, and
bindtextdomain.

Along with the above patch, someone should also try to move the call
to setlocale() outside #ifdef HAVE_NLS -- maybe that would be enough
to fix the problem.  Testers able to compile Wget and reproduce this
problem would be much appreciated.



Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe