Changeset 3548 for trunk/src/grep/src


Ignore:
Timestamp:
Jan 29, 2022, 3:41:10 AM (3 years ago)
Author:
bird
Message:

grep: Use get_crt_codepage(). Don't default to the UTF-8 manifest for older VCC versions as the CRT won't do the right thing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/grep/src/grep.c

    r3537 r3548  
    534534      g_fStdOutIsConsole = GetConsoleMode (s_hStdOut, &fModeIgnored)
    535535                         ? TRUE : FALSE;
    536       if (getenv("KMK_GREP_CONSOLE_DEBUG"))
    537         fprintf(stderr, "kmk_grep: g_fStdOutIsConsole=%d s_hStdOut=%p codepage=%u\n",
    538                 g_fStdOutIsConsole, s_hStdOut, ___lc_codepage_func());
     536      if (getenv ("KMK_GREP_CONSOLE_DEBUG"))
     537        fprintf (stderr, "kmk_grep: hStdOut=%p %sconsole codepage=%u ansi=%u\n",
     538                s_hStdOut, g_fStdOutIsConsole ? "" : "!",
     539                get_crt_codepage (), get_ansi_codepage ());
    539540    }
    540541  if (g_fStdOutIsConsole == TRUE && size && nmemb)
     
    560561          if (pawcBuf)
    561562            {
    562               int cwcToWrite = MultiByteToWideChar(___lc_codepage_func(),
     563              int cwcToWrite = MultiByteToWideChar(get_crt_codepage(),
    563564                                                   0 /*dwFlags*/,
    564565                                                   ptr, (int)cbToWrite,
Note: See TracChangeset for help on using the changeset viewer.