[Boost-bugs] [Boost C++ Libraries] #11526: mbtowc and wctomb are not implemented on Android

Subject: [Boost-bugs] [Boost C++ Libraries] #11526: mbtowc and wctomb are not implemented on Android
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-08-05 14:48:14


#11526: mbtowc and wctomb are not implemented on Android
-------------------------------------+---------------------------
 Reporter: jeff.diclemente@… | Owner: ramey
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost Development Trunk | Severity: Problem
 Keywords: Android |
-------------------------------------+---------------------------
 A runtime error occurs when using the Boost serialization library on
 Android. The symbols "mbtowc" and "mctomb" cannot be found by the linker.
 This occurs because the GNU C++ library provided by the Android NDK does
 not implement mbtowc and wctomb.

 A working example which demonstrates this error is attached. It is taken
 verbatim from the boost serialization example (i.e.
 boost/libs/serialization/examples/demo_xml.cpp).
 It can only be run on an Android device.

 The example program was built using the following:
 arm-linux-androideabi-g++ demo_xml.cpp -Iboost/include -std=c++11
 -Lboost/lib -lboost_wserialization -lboost_serialization

 The example program was built using a standalone GCC 4.8.0 ARM-v7a
 toolchain built from Android NDK r9 using boost 1.49.0.
 The issue still exists in the latest boost code in GitHub and with the
 latest Android NDK r10e (i.e. the C++ Library in Android NDK r10e was
 examined and "mbtowc" and "wctomb" still don't exist).

 To reproduce, build a standalone GCC toolchain for ARM-v7a by following
 the instructions here:
 https://developer.android.com/ndk/guides/standalone_toolchain.html and
 then build ./boost/libs/serialization/examples/demo_xml.cpp.


 I have a proposed fix for this which uses mbrtowc and wcrtomb, which are
 supported by the Android C++ library. I plan to submit a GitHub pull
 request.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11526>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC