Character encoding for validation