Skip to main content

validate_text_length

Function validate_text_length 

Source
pub fn validate_text_length(text: &str, field_name: &str) -> Result<()>
Expand description

Validate that text does not exceed MAX_TEXT_LENGTH characters.

Per the API docs, non-ASCII characters (emojis, CJK, accented Latin, etc.) are counted by their UTF-8 byte length rather than as single characters. ASCII characters count as 1 each.