Ed Dyreen wrote: ↑08 Jan 2019 02:27
How do I figure out which code page windows explorer is using ?
Windows Explorer is using UTF-16 LE always.
Now, to find out which is the default 8-bit code page for non-Unicode Windows apps in your localized version of Windows, aka. the "System Code Page", you need to look in the registry value ACP:
Code: Select all
C:\JFL\Temp>reg query "HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage" /v "ACP"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage
ACP REG_SZ 1252
C:\JFL\Temp>
My
codepage.exe tool gives you this and more:
Code: Select all
C:\JFL\Temp>codepage
Current console code page: 437 = OEM - United States
Default console code page: 437 = OEM - United States
System code page: 1252 = ANSI - Latin I
Console font: [TrueType] Liberation Mono
C:\JFL\Temp>
The console indeed defaults to the old DOS code page for your localization, for compatibility with old batch files written for DOS.
Changing it to the system code page makes things better, as it's likely to contain all characters you're likely to encounter in your language and neighboring ones.
Changing it to code page 65001 (UTF-8) is even better when dealing with file names, because it handles all Unicode characters, not just the 256 in your system code page.
But changing it to CP 65001 is more tricky when reading or writing files contents, as (contrary to Linux) very few files contain UTF-8 text in Windows.