NO

Author Topic: swprintf bug  (Read 2824 times)

Igor

  • Guest
swprintf bug
« 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"
« Last Edit: August 08, 2011, 03:18:48 PM by Igor »

Offline DMac

  • Member
  • *
  • Posts: 272
Re: swprintf bug
« Reply #1 on: August 08, 2011, 05:25:11 PM »
Try this:
Code: [Select]
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

  • Guest
Re: swprintf bug
« Reply #2 on: August 09, 2011, 01:56:09 AM »
oops)) i'm woodpecker)) thanks you)))))