Commit a808235e authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Use mbtowc/wctomb for string conversion in printf.

This changes printf behaviour for C locale. Signed-off-by: 's avatarPiotr Caban <piotr@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3fc11806
......@@ -1103,6 +1103,7 @@ int __cdecl _ismbblead_l(unsigned int, MSVCRT__locale_t);
int __cdecl _ismbclegal(unsigned int c);
int __cdecl _ismbstrail(const unsigned char* start, const unsigned char* str);
int __cdecl MSVCRT_mbtowc(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
int __cdecl MSVCRT_mbtowc_l(MSVCRT_wchar_t*,const char*,MSVCRT_size_t,MSVCRT__locale_t);
MSVCRT_size_t __cdecl MSVCRT_mbstowcs(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
MSVCRT_size_t __cdecl MSVCRT__mbstowcs_l(MSVCRT_wchar_t*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
MSVCRT_size_t __cdecl MSVCRT_wcstombs(char*,const MSVCRT_wchar_t*,MSVCRT_size_t);
......@@ -1128,6 +1129,7 @@ MSVCRT_size_t __cdecl MSVCRT_strnlen(const char *,MSVCRT_size_t);
MSVCRT_size_t __cdecl MSVCRT_wcsnlen(const MSVCRT_wchar_t*,MSVCRT_size_t);
MSVCRT_wchar_t*** __cdecl MSVCRT___p__wenviron(void);
INT __cdecl MSVCRT_wctomb(char*,MSVCRT_wchar_t);
int __cdecl MSVCRT__wctomb_l(char*, MSVCRT_wchar_t, MSVCRT__locale_t);
char* __cdecl MSVCRT__strdate(char* date);
char* __cdecl MSVCRT__strtime(char* date);
int __cdecl _setmbcp(int);
......
......@@ -106,6 +106,7 @@ static void test_sprintf( void )
double pnumber=789456123;
int x, r;
WCHAR wide[] = { 'w','i','d','e',0};
WCHAR buf_w[2];
format = "%+#23.15e";
r = sprintf(buffer,format,pnumber);
......@@ -786,6 +787,17 @@ static void test_sprintf( void )
ok(r==0, "r = %d\n", r);
ok(!strcmp(buffer, ""), "failed: \"%s\"\n", buffer);
format = "a%Cb";
r = sprintf(buffer, format, 0x3042);
ok(r==2, "r = %d\n", r);
ok(!strcmp(buffer, "ab"), "failed: \"%s\"\n", buffer);
format = "%S";
buf_w[0] = 0x3042;
buf_w[1] = 0;
r = sprintf(buffer, format, buf_w);
ok(r==-1 || broken(!r), "r = %d\n", r);
if(!setlocale(LC_ALL, "Japanese_Japan.932")) {
win_skip("Japanese_Japan.932 locale not available\n");
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment