The caracter number in the plugin "wire"

As an administrator, I have set the character count in Wire settings to 250. When I try to shoot a simple message with more characters than 227, I get the message "Excuse me. We were unable to save this wire post."

  • In PHP, text containing non-English characters may be perceived as having an increased number of characters due to how PHP processes string data. PHP utilizes a set of functions for string operations that are based on either single-byte or multi-byte encodings.

    If PHP is configured to work with single-byte encodings (e.g., ISO-8859-1), each character is represented by one byte. However, many non-English characters (such as Cyrillic characters, ideograms, etc.) are encoded in UTF-8 using multiple bytes.

    When handling strings that contain such characters without using multi-byte string functions (mbstring), PHP may incorrectly determine the length of the string and the number of characters it contains. For example, if you use the strlen() function to get the length of a string containing non-English characters in UTF-8, the result might show more characters than expected, as each multi-byte character will be considered as several single-byte characters.

  • We did use strlen instead of the mbstring version of that. I fixed it in https://github.com/Elgg/Elgg/pull/14715

    So it should improve shortly.