2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
16 /***********************************************************************
17 * GetACP (KERNEL32.148)
21 return 1252; /* Windows 3.1 ISO Latin */
24 /***********************************************************************
25 * GetCPInfo (KERNEL32.154)
27 BOOL
GetCPInfo(UINT codepage
, LPCPINFO cpinfo
)
29 cpinfo
->MaxCharSize
= 1;
30 cpinfo
->DefaultChar
[0] = '?';
35 /***********************************************************************
36 * GetOEMCP (KERNEL32.248)
40 return 437; /* MS-DOS United States */
43 /***********************************************************************
44 * MultiByteToWideChar (KERNEL32.392)
46 int MultiByteToWideChar(UINT page
, DWORD flags
, char *src
, int srclen
,
47 WCHAR
*dst
, int dstlen
)
49 return (srclen
==-1) ? strlen(src
) * 2: srclen
*2;
52 int WideCharToMultiByte(UINT page
, DWORD flags
, WCHAR
*src
, int srclen
,
53 char *dst
, int dstlen
, char* defchar
, BOOL
*used
)
56 int dont_copy
= (dstlen
==0);
57 if(page
!=GetACP() && page
!=CP_OEMCP
&& page
!=CP_ACP
)
58 fprintf(stdnimp
,"Conversion in CP %d not supported\n",page
);
60 fprintf(stdnimp
,"WideCharToMultiByte flags %lx not supported\n",flags
);
63 while(srclen
&& (dont_copy
|| dstlen
))
70 /* FIXME: Is this correct ?*/
71 if(flags
& WC_DEFAULTCHAR
){
72 *dst
= defchar
? *defchar
: '?';
82 if(srclen
!=-1)srclen
--;