From f71e1349c14a1afb776040e955f1682aeb512986 Mon Sep 17 00:00:00 2001 From: CPunch Date: Fri, 21 Aug 2020 22:11:04 -0500 Subject: [PATCH] temp fix for U16toU8 edgecase --- src/CNStructs.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CNStructs.cpp b/src/CNStructs.cpp index 2885f36..b580cc3 100644 --- a/src/CNStructs.cpp +++ b/src/CNStructs.cpp @@ -1,8 +1,12 @@ #include "CNStructs.hpp" std::string U16toU8(char16_t* src) { - std::wstring_convert,char16_t> convert; - return convert.to_bytes(src); + try { + std::wstring_convert,char16_t> convert; + return convert.to_bytes(src); + } catch(std::exception e) { + return ""; + } } // returns number of char16_t that was written at des