Peter Kümmel wrote:
Could we not replace the current implementation of
unsigned short ucs4_to_ucs2(boost::uint32_t c)
with such a inline implementation, because iconv must
in principle do the same.
char_type const UNI_REPLACEMENT_CHAR 0x0000FFFD
char_type const UNI_SUR_HIGH_START 0xD800;
char_type const UNI_SUR_LOW_END 0xDFFF;
unsigned short ucs4_to_ucs2(boost::uint32_t ucs4)
{
if (ucs4 >= 0xFFFE || (ucs4 >= UNI_SUR_HIGH_START && ucs4 <=
UNI_SUR_LOW_END))
return UnknownChar;
return static_cast<unsigned short>(ucs4);
}
Good idea. That would be fine with me. We just need Lars to express his
opinion but that could take some time ;-)
Abdel.