From 1adfaa081fd27d653619c84c520c16516c530ab1 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 1 Jun 2016 16:56:04 +0300 Subject: MAINT-6446 Correct password length handling --- indra/llcommon/llstring.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/llcommon/llstring.h') diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 393f6d7a8c..a40db0f8cc 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -563,6 +563,17 @@ LL_COMMON_API S32 utf8str_compare_insensitive( const std::string& lhs, const std::string& rhs); +/** +* @brief Properly truncate a utf8 string to a maximum character count. +* +* If symbol_len is longer than the string passed in, the return +* value == utf8str. +* @param utf8str A valid utf8 string to truncate. +* @param symbol_len The maximum number of symbols in the return value. +* @return Returns a valid utf8 string with symbol count <= max_len. +*/ +LL_COMMON_API std::string utf8str_symbol_truncate(const std::string& utf8str, const S32 symbol_len); + /** * @brief Replace all occurences of target_char with replace_char * -- cgit v1.2.3