src/win32.cpp
changeset 6276 2bac13107db6
parent 6275 9d330e242010
child 6298 01c80746f308
equal deleted inserted replaced
6275:9d330e242010 6276:2bac13107db6
   882 {
   882 {
   883 	int argc;
   883 	int argc;
   884 	char *argv[64]; // max 64 command line arguments
   884 	char *argv[64]; // max 64 command line arguments
   885 	char *cmdline;
   885 	char *cmdline;
   886 
   886 
       
   887 #if !defined(UNICODE)
       
   888 	_codepage = GetACP(); // get system codepage as some kind of a default
       
   889 #endif /* UNICODE */
       
   890 
   887 #if defined(UNICODE)
   891 #if defined(UNICODE)
   888 	/* For UNICODE we need to convert the commandline to char* _AND_
   892 	/* For UNICODE we need to convert the commandline to char* _AND_
   889 	 * save it because argv[] points into this buffer and thus needs to
   893 	 * save it because argv[] points into this buffer and thus needs to
   890 	 * be available between subsequent calls to FS2OTTD() */
   894 	 * be available between subsequent calls to FS2OTTD() */
   891 	char cmdlinebuf[MAX_PATH];
   895 	char cmdlinebuf[MAX_PATH];
   892 #endif
   896 #endif /* UNICODE */
   893 
   897 
   894 	cmdline = WIDE_TO_MB_BUFFER(GetCommandLine(), cmdlinebuf, lengthof(cmdlinebuf));
   898 	cmdline = WIDE_TO_MB_BUFFER(GetCommandLine(), cmdlinebuf, lengthof(cmdlinebuf));
   895 
   899 
   896 #if defined(_DEBUG)
   900 #if defined(_DEBUG)
   897 	CreateConsole();
   901 	CreateConsole();