Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Commit

Permalink
Untabify
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg1969 committed May 19, 2016
1 parent 75f0dca commit 8cda452
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/nanodbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,22 +213,22 @@ namespace

inline void convert(const wide_string_type& in, std::string& out)
{
// Why static converters?
// See http://stackoverflow.com/questions/26196686/utf8-utf16-codecvt-poor-performance
#ifdef NANODBC_USE_BOOST_CONVERT
// Why static converters?
// See http://stackoverflow.com/questions/26196686/utf8-utf16-codecvt-poor-performance
#ifdef NANODBC_USE_BOOST_CONVERT
using boost::locale::conv::utf_to_utf;
out = utf_to_utf<char>(in.c_str(), in.c_str() + in.size());
#else
#if defined(_MSC_VER) && (_MSC_VER == 1900)
#if defined(_MSC_VER) && (_MSC_VER == 1900)
// Workaround for confirmed bug in VS2015. See:
// https://connect.microsoft.com/VisualStudio/Feedback/Details/1403302
// https://social.msdn.microsoft.com/Forums/en-US/8f40dcd8-c67f-4eba-9134-a19b9178e481/vs-2015-rc-linker-stdcodecvt-error
// Why static? http://stackoverflow.com/questions/26196686/utf8-utf16-codecvt-poor-performance
// Why static? http://stackoverflow.com/questions/26196686/utf8-utf16-codecvt-poor-performance
auto p = reinterpret_cast<unsigned short const*>(in.data());
static std::wstring_convert<NANODBC_CODECVT_TYPE<unsigned short>, unsigned short> converter;
out = converter.to_bytes(p, p + in.size());
static std::wstring_convert<NANODBC_CODECVT_TYPE<unsigned short>, unsigned short> converter;
out = converter.to_bytes(p, p + in.size());
#else
static std::wstring_convert<NANODBC_CODECVT_TYPE<wide_char_t>, wide_char_t> converter;
static std::wstring_convert<NANODBC_CODECVT_TYPE<wide_char_t>, wide_char_t> converter;
out = converter.to_bytes(in);
#endif
#endif
Expand All @@ -244,12 +244,12 @@ namespace
// Workaround for confirmed bug in VS2015. See:
// https://connect.microsoft.com/VisualStudio/Feedback/Details/1403302
// https://social.msdn.microsoft.com/Forums/en-US/8f40dcd8-c67f-4eba-9134-a19b9178e481/vs-2015-rc-linker-stdcodecvt-error
static std::wstring_convert<NANODBC_CODECVT_TYPE<unsigned short>, unsigned short> converter;
auto s = converter.from_bytes(in);
static std::wstring_convert<NANODBC_CODECVT_TYPE<unsigned short>, unsigned short> converter;
auto s = converter.from_bytes(in);
auto p = reinterpret_cast<wide_char_t const*>(s.data());
out.assign(p, p + s.size());
#else
static std::wstring_convert<NANODBC_CODECVT_TYPE<wide_char_t>, wide_char_t> converter;
static std::wstring_convert<NANODBC_CODECVT_TYPE<wide_char_t>, wide_char_t> converter;
out = converter.from_bytes(in);
#endif
}
Expand Down

0 comments on commit 8cda452

Please sign in to comment.