diff --git a/nel/src/misc/utf_string_view.cpp b/nel/src/misc/utf_string_view.cpp index 283ef9555..8808930b4 100644 --- a/nel/src/misc/utf_string_view.cpp +++ b/nel/src/misc/utf_string_view.cpp @@ -287,6 +287,12 @@ u32char CUtfStringView::utf8Iterator(const void **addr) // Replacement character � return 0xFFFD; } + else if (c0 < 0x10000) + { + // Invalid encoding + // Replacement character � + return 0xFFFD; + } } else { @@ -320,6 +326,12 @@ u32char CUtfStringView::utf8Iterator(const void **addr) // Replacement character � return 0xFFFD; } + else if (c0 < 0x0800) + { + // Invalid encoding + // Replacement character � + return 0xFFFD; + } } else { @@ -327,6 +339,12 @@ u32char CUtfStringView::utf8Iterator(const void **addr) return 0xFFFD; } } + else if (c0 < 0x80) + { + // Invalid encoding + // Replacement character � + return 0xFFFD; + } } else {