fixed entity encoding