-
Per Hedbor authored
An empty string: - IS lowercase - IS uppercase 'STRING_IS_LOWERCASE' means the same string will be returned for lower_case(str), and 'STRING_IS_UPPERCASE' means the same string will be returned for upper_case(str). Having this be wrong for the empty string is not really a good idea, since when strings are constructed using += the bits will not be set correctly if you start with the empty string. Also note: All code using string ranges really needs a special case for the empty string, since its range of characters, when checked using check_string_range, will be 0..255 (loose check), or -MAX_INT32..MAX_INT32 (non-loose check). This is done correctly in the 'string_has_null' function, which is what is supposed to be used to check if strings contain null characters.
Per Hedbor authoredAn empty string: - IS lowercase - IS uppercase 'STRING_IS_LOWERCASE' means the same string will be returned for lower_case(str), and 'STRING_IS_UPPERCASE' means the same string will be returned for upper_case(str). Having this be wrong for the empty string is not really a good idea, since when strings are constructed using += the bits will not be set correctly if you start with the empty string. Also note: All code using string ranges really needs a special case for the empty string, since its range of characters, when checked using check_string_range, will be 0..255 (loose check), or -MAX_INT32..MAX_INT32 (non-loose check). This is done correctly in the 'string_has_null' function, which is what is supposed to be used to check if strings contain null characters.