ctypes.windll.kernel32.GetConsoleCP() returns always 0 from within Sublime Text. Is this a consequence of Python being embedded?
I'd it's because there is no console associated with the current process. I won't ask why you want to get the current code page, but perhaps the win32 function GetACP() will give you what you're after?
I might be doing something wrong --no wait, I surely am doing something wrong--, but I'm interfacing with Powershell from a sublime plugin and the whole OEM/Ansi codepage business in Windows requires me to know what codepage the console's currently using. I found a workaround, but I thought it'd be cleaner to get the codepage from python...