wcstombs() has invalid output on Android

I'm trying to port some old C/C++ code to android(latest version of NDK), but I'm struggling with function wcstombs(). This function returns wierd result on Android and I don't know why. 
Look at this code (it's wcstombs() example from C++ reference)
  const wchar_t str[] = L"wcstombs example";
  char buffer[32];
  int ret;

  ret = wcstombs ( buffer, str, sizeof(buffer) );
  if (ret==32) buffer[31]='\0';

  __android_log_print(ANDROID_LOG_WARN, "dbg", "%d ... %s", ret, buffer);

// Application.mk
APP_ABI := armeabi-v7a
APP_STL := gnustl_static
APP_PLATFORM := android-19

This code prints "2 ... w". It looks like the function stops, if it reads a zero byte from the string.
Is it normal? Is there any replacement for this function?
Thx.

I've finally found the solution to this problem. Application has to be linked against LLVM libc++ instead of GNU STL.
Application.mk should look like this:
APP_ABI := armeabi-v7a
APP_STL := c++_static
APP_PLATFORM := android-19