1

Assume:

char from[10]="abcd";
wchar_t to[10]=L"";

In gcc under Linux and MSVC, I can use: sscanf(from, "%S", to); to get a wchar_t string L"abcd" in to. But this does not work in NDK.

I want to know whether this is supported in NDK? Is there any alternatives?

I know I can use a copy loop to accomplish this:

for (int i = 0; i <= strlen(from); ++i)
    to[i] = from[i];

I'm using android-ndk-r7-crystax-5.beta2-linux-x86.tar.bz2 . My string contains only ASCII characters, so I'm don't want use iconv.

Sergey Kalinichenko
  • 714,442
  • 84
  • 1,110
  • 1,523
fefe
  • 3,342
  • 2
  • 23
  • 45

1 Answers1

0

google android ndk said:support wchar function。but some wchar function just provided empty. such as:wsclen(), always return 1. you can use http://www.crystax.net/ ndk,

BenMorel
  • 34,448
  • 50
  • 182
  • 322
nightday
  • 1
  • 1
  • 1