From cd059bd51177d146ad44bbc404254d9ed4f43d6c Mon Sep 17 00:00:00 2001 From: Evgeny Pestov Date: Thu, 16 Dec 2021 21:36:37 +0700 Subject: [PATCH] Show questions instead of crushing in case of UTF-8 errors --- src/common/stringutils.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/common/stringutils.cpp b/src/common/stringutils.cpp index 1aa97920..3e99a7b7 100644 --- a/src/common/stringutils.cpp +++ b/src/common/stringutils.cpp @@ -182,10 +182,6 @@ int StrUtils::Utf8CharSizeAt(const std::string &str, unsigned int pos) if((c & 0xE0) == 0xC0) return 2; - // Invalid char - unexpected continuation byte - if((c & 0xC0) == 0x80) - throw std::invalid_argument("Unexpected UTF-8 continuation byte"); - return 1; }