Hi, I think I found a minor bug. When using sf::Utf16 t encode the Unicode character U+FFFF, it is incorrectly encoded as a surrogate pair, while it should be encoded as a single code unit. For confirmation,
RFC 2781, which specifies the UTF-16 encoding, specifies in section 2.1:
If U < 0x10000, encode U as a 16-bit unsigned integer and terminate.
U+FFFF (0xFFFF) fulfills this requirement, so it should be encoded as a single code unit. However,
include/SFML/System/Utf.inl at line 325 encodes a code point into a single code unit only if it is
strictly inferior to 0xFFFF, whereas it should be
inferior or equal in order to account for the edge-case that is U+FFFF.
Now, since U+FFFF is barely ever used by applications, this is not going to end the world, but I thought it might be good to report it nonetheless.
NOTE: This is my first post on this forum, so I apologize if this is not the right place to post this.