Text processing
Check the encoding before counting, comparing or transforming text. Unicode characters may contain multiple code points, so byte counts and character counts can differ.
Keep an original copy and verify the result when converting legacy encodings or replacing text in bulk.