53{
54 const char format[] =
".%d";
55
56 int newcp;
60 char bufA[256];
62 int charcount;
65
66 if(!mbcinfo)
68
70 {
73 break;
76 break;
79 if(newcp)
80 break;
81
83 newcp = 20127;
84 break;
85 default:
87 break;
88 }
89
90 if(lcid == -1) {
93 } else {
95 }
96
98 {
99 WARN(
"Can't assign LCID to codepage (%d)\n", mbcinfo->
mblcid);
101 }
102
104 {
105 WARN(
"Codepage %d not found\n", newcp);
107 return -1;
108 }
109
110
113
116 {
120 }
121
123 {
124
126
129 {
130 if (cpextra->
cp == 0 || cpextra->
cp == newcp)
131 {
132 if (cpextra->
cp == 0)
133 FIXME(
"trail bytes data not available for DBCS codepage %d - assuming all bytes\n", newcp);
134
137 {
141 }
142 break;
143 }
144 cpextra++;
145 }
146 }
147 else
149
150
151
152 charcount = 0;
153 for (
i = 0;
i < 256;
i++)
155 bufA[charcount++] =
i;
156
158 if (
ret != charcount)
159 ERR(
"MultiByteToWideChar of chars failed for cp %d, ret=%d (exp %d), error=%d\n", newcp,
ret, charcount,
GetLastError());
160
162
163 charcount = 0;
164 for (
i = 0;
i < 256;
i++)
166 {
167 if (chartypes[charcount] &
C1_UPPER)
168 {
170 bufW[charcount] =
tolowerW(bufW[charcount]);
171 }
172 else if (chartypes[charcount] &
C1_LOWER)
173 {
175 bufW[charcount] =
toupperW(bufW[charcount]);
176 }
177 charcount++;
178 }
179
181 if (
ret != charcount)
182 ERR(
"WideCharToMultiByte failed for cp %d, ret=%d (exp %d), error=%d\n", newcp,
ret, charcount,
GetLastError());
183
184 charcount = 0;
185 for (
i = 0;
i < 256;
i++)
186 {
188 {
191 charcount++;
192 }
193 }
194
195 if (newcp == 932)
196 {
197
198
199
200
201
202 for (
i = 161;
i <= 165;
i++)
204 for (
i = 166;
i <= 223;
i++)
206 }
207
211
212 return 0;
213}
static struct cp_extra_info_t g_cpextrainfo[]
static unsigned char bytes[4]
#define WideCharToMultiByte
#define MultiByteToWideChar
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
UINT WINAPI GetOEMCP(void)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
_CRTIMP unsigned char _mbctype[257]
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
LCID MSVCRT_locale_to_LCID(const char *)
MSVCRT_pthreadmbcinfo get_mbcinfo(void)
_CRTIMP int *__cdecl _errno(void)
unsigned char mbcasemap[256]
unsigned char mbctype[257]
BYTE LeadByte[MAX_LEADBYTES]
DWORD WINAPI GetLastError(void)