Correctly trim long messages with special characters.