From fe21919c02ee5cfe11ebfa46cb2ed0d8821538c4 Mon Sep 17 00:00:00 2001 From: beanjoy <120680451@qq.com> Date: Mon, 18 Nov 2019 19:22:20 +0800 Subject: [PATCH] =?UTF-8?q?utf8=E8=BD=AC=E6=8D=A2=E4=B8=BAutf16=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8config?= =?UTF-8?q?=E5=92=8C=E7=BC=96=E8=AF=91=E3=80=81=E5=AE=89=E8=A3=85=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Release/config_build_install.bat | 25 +++++++++++++++++++++++++ Release/src/utilities/asyncrt_utils.cpp | 16 ++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 Release/config_build_install.bat diff --git a/Release/config_build_install.bat b/Release/config_build_install.bat new file mode 100644 index 0000000000..a5a8d4841a --- /dev/null +++ b/Release/config_build_install.bat @@ -0,0 +1,25 @@ +@echo off + +cd /d "%~pd0" + +if not exist build ( + + mkdir build + cd build + + "D:\Program Files (x86)\cmake-3.16.0-rc3-win64-x64\bin\cmake.exe" .. -G "Visual Studio 14 2015 Win64" -DCPPREST_PPLX_IMPL:STRING="winpplx" -DCPPREST_EXCLUDE_COMPRESSION:BOOL="1" -DCMAKE_CONFIGURATION_TYPES:STRING="Debug;Release" -DBoost_USE_STATIC_LIBS:BOOL="1" -DBOOST_INCLUDEDIR:PATH="D:\code\opensource\boost_1_67_0" -DBOOST_LIBRARYDIR:PATH="D:\code\opensource\boost_1_67_0\x64\lib" -DWERROR:BOOL="0" -DBUILD_SAMPLES:BOOL="0" -DBUILD_TESTS:BOOL="0" + +) else ( + + cd build + +) + + +rem %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" amd64 +call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 + +msbuild cpprestsdk.sln /p:Configuration=Release +msbuild INSTALL.vcxproj /p:Configuration=Release + +pause diff --git a/Release/src/utilities/asyncrt_utils.cpp b/Release/src/utilities/asyncrt_utils.cpp index 5263c8d5d5..e006166bca 100644 --- a/Release/src/utilities/asyncrt_utils.cpp +++ b/Release/src/utilities/asyncrt_utils.cpp @@ -345,19 +345,19 @@ inline size_t count_utf8_to_utf16(const std::string& s) if ((c & BIT7) == 0) { - throw std::range_error("UTF-8 string character can never start with 10xxxxxx"); + // throw std::range_error("UTF-8 string character can never start with 10xxxxxx"); } else if ((c & BIT6) == 0) // 2 byte character, 0x80 to 0x7FF { if (index == sSize) { - throw std::range_error("UTF-8 string is missing bytes in character"); + // throw std::range_error("UTF-8 string is missing bytes in character"); } const UtilCharInternal_t c2 {sData[index++]}; if ((c2 & 0xC0) != BIT8) { - throw std::range_error("UTF-8 continuation byte is missing leading bit mask"); + // throw std::range_error("UTF-8 continuation byte is missing leading bit mask"); } // can't require surrogates for 7FF @@ -367,14 +367,14 @@ inline size_t count_utf8_to_utf16(const std::string& s) { if (sSize - index < 2) { - throw std::range_error("UTF-8 string is missing bytes in character"); + // throw std::range_error("UTF-8 string is missing bytes in character"); } const UtilCharInternal_t c2 {sData[index++]}; const UtilCharInternal_t c3 {sData[index++]}; if (((c2 | c3) & 0xC0) != BIT8) { - throw std::range_error("UTF-8 continuation byte is missing leading bit mask"); + // throw std::range_error("UTF-8 continuation byte is missing leading bit mask"); } result -= 2; @@ -383,7 +383,7 @@ inline size_t count_utf8_to_utf16(const std::string& s) { if (sSize - index < 3) { - throw std::range_error("UTF-8 string is missing bytes in character"); + // throw std::range_error("UTF-8 string is missing bytes in character"); } const UtilCharInternal_t c2 {sData[index++]}; @@ -391,7 +391,7 @@ inline size_t count_utf8_to_utf16(const std::string& s) const UtilCharInternal_t c4 {sData[index++]}; if (((c2 | c3 | c4) & 0xC0) != BIT8) { - throw std::range_error("UTF-8 continuation byte is missing leading bit mask"); + // throw std::range_error("UTF-8 continuation byte is missing leading bit mask"); } const uint32_t codePoint = @@ -400,7 +400,7 @@ inline size_t count_utf8_to_utf16(const std::string& s) } else { - throw std::range_error("UTF-8 string has invalid Unicode code point"); + // throw std::range_error("UTF-8 string has invalid Unicode code point"); } }