Pelles C forum

Pelles C => Bug reports => Topic started by: Igor on August 08, 2011, 02:33:38 PM

Title: swprintf bug
Post by: Igor on August 08, 2011, 02:33:38 PM
swprintf, swprintf_s, _snwprintf incorrect work with cyrillic symbols

//
wchar_t buf[MAX_PATH];
swprintf(buf, MAX_PATH, L"%s", L"АБВГД")

result buf = "" //pasta o_O))

but maybe i incorrect used it? =)

wsprintfW(buf, L"%s", L"АБВГД");
result buf is ok

PS: with asian symbols have the same problem
swprintf(buf, MAX_PATH, L"%s", L"あいうえお");
buf = "B0D0F0H0J0"
Title: Re: swprintf bug
Post by: DMac on August 08, 2011, 05:25:11 PM
Try this:
Code: [Select]
wchar_t buf[MAX_PATH];
swprintf(buf, MAX_PATH, L"%ls", L"АБВГД")
Title: Re: swprintf bug
Post by: Igor on August 09, 2011, 01:56:09 AM
oops)) i'm woodpecker)) thanks you)))))