Skip to content

Commit aec3766

Browse files
committed
Starting to remove the Boost.Locale and libiconv dependency on Linux and Android.
1 parent 22c4c69 commit aec3766

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Release/src/utilities/asyncrt_utils.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030
#include <boost/date_time/posix_time/posix_time_io.hpp>
3131
#endif
3232

33-
#if defined(__GLIBCXX__)
34-
#include "boost/locale.hpp"
35-
#else
36-
// Not supported on libstdc++
33+
// Could use C++ standard library if not __GLIBCXX__,
34+
// For testing purposes we just the handwritten on all platforms.
35+
#if defined(CPPREST_STDLIB_UTF_CONVERSIONS)
3736
#include <codecvt>
3837
#endif
3938

@@ -253,23 +252,24 @@ const std::error_category & __cdecl linux_category()
253252

254253
}
255254

256-
utf16string __cdecl conversions::utf8_to_utf16(const std::string &s)
255+
utf16string __cdecl conversions::utf8_to_utf16(const std::string &src)
257256
{
258-
#if defined(__GLIBCXX__)
259-
return boost::locale::conv::utf_to_utf<utf16char>(s, boost::locale::conv::stop);
260-
#else
257+
#if defined(CPPREST_STDLIB_UTF_CONVERSIONS)
261258
std::wstring_convert<std::codecvt_utf8_utf16<utf16char>, utf16char> conversion;
262-
return conversion.from_bytes(s);
259+
return conversion.from_bytes(src);
260+
#else
261+
262+
// TODO
263263
#endif
264264
}
265265

266266
std::string __cdecl conversions::utf16_to_utf8(const utf16string &w)
267267
{
268-
#if defined(__GLIBCXX__)
269-
return boost::locale::conv::utf_to_utf<char>(w, boost::locale::conv::stop);
270-
#else
268+
#if defined(CPPREST_STDLIB_UTF_CONVERSIONS)
271269
std::wstring_convert<std::codecvt_utf8_utf16<utf16char>, utf16char> conversion;
272270
return conversion.to_bytes(w);
271+
#else
272+
// TODO
273273
#endif
274274
}
275275

0 commit comments

Comments
 (0)