comparison src/mbyte.c @ 18014:82543df649ba v8.1.2003

patch 8.1.2003: MS-Windows: code page 65001 is not recognized Commit: https://github.com/vim/vim/commit/fa90d70884ee208966b84052080a7d5eeb8ac2d5 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 7 16:07:47 2019 +0200 patch 8.1.2003: MS-Windows: code page 65001 is not recognized Problem: MS-Windows: code page 65001 is not recognized. Solution: Use utf-8 for code page 65001. (Dan Thompson, closes https://github.com/vim/vim/issues/4902)
author Bram Moolenaar <Bram@vim.org>
date Sat, 07 Sep 2019 16:15:03 +0200
parents 8ae333756614
children d1e77015f60b
comparison
equal deleted inserted replaced
18013:438192d859f3 18014:82543df649ba
4466 char buf[50]; 4466 char buf[50];
4467 long acp = GetACP(); 4467 long acp = GetACP();
4468 4468
4469 if (acp == 1200) 4469 if (acp == 1200)
4470 STRCPY(buf, "ucs-2le"); 4470 STRCPY(buf, "ucs-2le");
4471 else if (acp == 1252) /* cp1252 is used as latin1 */ 4471 else if (acp == 1252) // cp1252 is used as latin1
4472 STRCPY(buf, "latin1"); 4472 STRCPY(buf, "latin1");
4473 else if (acp == 65001)
4474 STRCPY(buf, "utf-8");
4473 else 4475 else
4474 sprintf(buf, "cp%ld", acp); 4476 sprintf(buf, "cp%ld", acp);
4475 4477
4476 return enc_canonize((char_u *)buf); 4478 return enc_canonize((char_u *)buf);
4477 #else 4479 #else