This is wrong. The entity is a codepoint (a `u32`), not a UTF-16 value. `x` needs to be typed as `u32` and you should be converting it to a char using `char::from_u32()`, as I suggested before. This also means you need to explicitly handle `0` => `U+FFFD`.