News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

swprintf bug

Started by Igor, August 08, 2011, 02:33:38 PM

Previous topic - Next topic

Igor

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"

DMac

Try this:
wchar_t buf[MAX_PATH];
swprintf(buf, MAX_PATH, L"%ls", L"АБВГД")
No one cares how much you know,
until they know how much you care.

Igor

oops)) i'm woodpecker)) thanks you)))))