lib/icu/Util: UCharFromUTF8() throws on error

This commit is contained in:
Max Kellermann
2016-04-21 11:20:41 +02:00
parent 423cd5900e
commit 21f17270a1
4 changed files with 15 additions and 8 deletions

View File

@@ -129,7 +129,7 @@ try {
AllocatedString<char>
IcuConverter::FromUTF8(const char *s) const
{
try {
#ifdef HAVE_ICU
const ScopeLock protect(mutex);
@@ -156,6 +156,8 @@ IcuConverter::FromUTF8(const char *s) const
#elif defined(HAVE_ICONV)
return DoConvert(from_utf8, s);
#endif
} catch (const std::runtime_error &) {
return nullptr;
}
#endif