Merge fixes for handling Unicode characters outside of BMP

Closes https://github.com/wxWidgets/wxWidgets/pull/467
This commit is contained in:
Vadim Zeitlin
2017-06-21 18:53:40 +02:00
10 changed files with 483 additions and 119 deletions

View File

@@ -83,6 +83,82 @@ public:
*/
bool GetAsChar(char *c) const;
/**
Returns true if the character is a BMP character (i.e.\ if its value is less than 0x10000).
@since 3.1.1
*/
bool IsBMP() const;
/**
Returns true if the character is a BMP character (i.e.\ if its value is less than 0x10000).
@param value
The Unicode code point of the character.
@since 3.1.1
*/
static bool IsBMP(wxUint32 value);
/**
Returns true if the character is a supplementary character (i.e.\ between 0x10000 and 0x10FFFF).
@since 3.1.1
*/
bool IsSupplementary() const;
/**
Returns true if the character is a supplementary character (i.e.\ between 0x10000 and 0x10FFFF).
@param value
The Unicode code point of the character.
@since 3.1.1
*/
static bool IsSupplementary(wxUint32 value);
/**
Returns the high surrogate code unit for the supplementary character.
@pre IsSupplementary() const
@since 3.1.1
*/
wxUint16 HighSurrogate() const;
/**
Returns the high surrogate code unit for the supplementary character.
@param value
The Unicode code point of the character.
@pre IsSupplementary(wxUint32 value)
@since 3.1.1
*/
static wxUint16 HighSurrogate(wxUint32 value);
/**
Returns the low surrogate code unit for the supplementary character.
@pre IsSupplementary() const
@since 3.1.1
*/
wxUint16 LowSurrogate() const;
/**
Returns the low surrogate code unit for the supplementary character.
@param value
The Unicode code point of the character.
@pre IsSupplementary(wxUint32 value)
@since 3.1.1
*/
static wxUint16 LowSurrogate(wxUint32 value);
//@{
/**
Conversions to char and wchar_t types: all of those are needed to be