Patch 8.2.2894
Problem:    MS-Windows: using enc_locale() for strftime() might not work.
Solution:   Use wcsftime(). (Ken Takata, closes #8271)
Files:      src/time.c


*** ../vim-8.2.2893/src/time.c  2021-01-20 22:22:45.736246959 +0100
--- src/time.c  2021-05-28 15:45:49.347106427 +0200
***************
*** 252,258 ****
      void
  f_strftime(typval_T *argvars, typval_T *rettv)
  {
-     char_u    result_buf[256];
      struct tm tmval;
      struct tm *curtime;
      time_t    seconds;
--- 252,257 ----
***************
*** 271,276 ****
--- 270,289 ----
        rettv->vval.v_string = vim_strsave((char_u *)_("(Invalid)"));
      else
      {
+ # ifdef MSWIN
+       WCHAR       result_buf[256];
+       WCHAR       *wp;
+ 
+       wp = enc_to_utf16(p, NULL);
+       if (wp != NULL)
+           (void)wcsftime(result_buf, sizeof(result_buf) / sizeof(WCHAR),
+                                                               wp, curtime);
+       else
+           result_buf[0] = NUL;
+       rettv->vval.v_string = utf16_to_enc(result_buf, NULL);
+       vim_free(wp);
+ # else
+       char_u      result_buf[256];
        vimconv_T   conv;
        char_u      *enc;
  
***************
*** 296,301 ****
--- 309,315 ----
        // Release conversion descriptors
        convert_setup(&conv, NULL, NULL);
        vim_free(enc);
+ # endif
      }
  }
  # endif
*** ../vim-8.2.2893/src/version.c       2021-05-28 14:11:59.725797039 +0200
--- src/version.c       2021-05-28 15:48:37.858644557 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2894,
  /**/

-- 
Yesterday is history.
Tomorrow is a mystery.
Today is a gift.
That's why it is called 'present'.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202105281350.14SDo4NG1255779%40masaka.moolenaar.net.

Raspunde prin e-mail lui