Home Download Buy Blog Forum Support

ctypes.windll.kernel32.GetConsoleCP()

ctypes.windll.kernel32.GetConsoleCP()

Postby guillermooo on Thu Mar 25, 2010 7:34 pm

ctypes.windll.kernel32.GetConsoleCP() returns always 0 from within Sublime Text. Is this a consequence of Python being embedded?
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: ctypes.windll.kernel32.GetConsoleCP()

Postby jps on Mon Apr 12, 2010 9:28 am

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?
jps
Site Admin
 
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm

Re: ctypes.windll.kernel32.GetConsoleCP()

Postby guillermooo on Mon Apr 12, 2010 9:38 am

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...

http://bitbucket.org/guillermooo/powershellutils/src/b722eb9bd360/executepscommand.py#cl-106
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests