@@ -213,8 +213,15 @@ TString str_trim_single(TString sin, const TString& trimChars=" \t\n") {
213
213
return sin;
214
214
}
215
215
216
- // This works for NativeCharSize encoded chars, including in utf8 encoding space.
217
- // This wont work for multibyte encoded chars.
216
+ // Convert to lower case, if language has upper and lower case semantic
217
+ //
218
+ // This works for fixed size encoded char spaces.
219
+ //
220
+ // For variable length encoded char spaces, it can work
221
+ // * if one is doing the conversion for languages which fit into NativeCharSized chars in it
222
+ // * AND if one is working with a sane variable length encoding standard
223
+ // * ex: this will work if trying to do the conversion for english language within utf-8
224
+ //
218
225
template <typename TString>
219
226
TString str_tolower (const TString &sin) {
220
227
TString sout;
@@ -539,7 +546,8 @@ void check_nonenglish() {
539
546
for (auto sTest : vTest1) {
540
547
std::string sGotDumb = str_trim_dumb (sTest , {" \n\t " });
541
548
std::string sGotOSmart = str_trim_oversmart (sTest , {" \n\t " });
542
- std::cout << std::format (" {}: Test1[{}] Dumb[{}] OverSmart[{}]" , __func__, sTest , sGotDumb , sGotOSmart ) << std::endl;
549
+ std::string sLower = str_tolower (sTest );
550
+ std::cout << std::format (" {}: Test1 [{}]\n\t TrimDumb[{}]\n\t TrimOverSmart[{}]\n\t LowerDumb[{}]" , __func__, sTest , sGotDumb , sGotOSmart , sLower ) << std::endl;
543
551
}
544
552
// The string "\n\tthis र remove 0s and अs at end 000रअ0\xa4अ ",
545
553
// * will mess up str_trim_dumb,
0 commit comments