wx.UniChar¶
This class represents a single Unicode character.
It can be converted to and from char
or wchar_t
and implements commonly used character operations.
Class Hierarchy¶
Methods Summary¶
Returns |
|
Returns Unicode code point value of the character. |
|
Returns the high surrogate code unit for the supplementary character. |
|
Returns |
|
Returns |
|
Returns |
|
Returns the low surrogate code unit for the supplementary character. |
Properties Summary¶
See |
Class API¶
- class wx.UniChar(object)¶
Possible constructors:
UniChar(c) -> None UniChar(c) -> None
This class represents a single Unicode character.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self, c)
- Parameters:
c (long)
- Return type:
None
__init__ (self, c)
- Parameters:
c (long)
- Return type:
None
- GetAsChar(self, c)¶
Returns
True
if the character is representable as a single byte in the current locale encoding.This function only returns
True
if the character can be converted in exactly one byte, e.g. it only returnsTrue
for 7 bitASCII
characters when the encoding used isUTF-8
.It is mostly useful to test if the character can be passed to functions taking a int and is used by wxWidgets itself for this purpose.
- Parameters:
c (int) – An output pointer to the value of this Unicode character as a
char
. Must be notNone
.- Return type:
bool
- Returns:
True
if the object is an 8 bit int and c was filled with its value as int orFalse
otherwise (c won’t be modified then).
Added in version 2.9.1.
See also
- GetValue(self)¶
Returns Unicode code point value of the character.
- Return type:
value_type
- HighSurrogate(self, *args, **kw)¶
-
HighSurrogate (self)
Returns the high surrogate code unit for the supplementary character.
- Return type:
wx.Uint16
Added in version 4.1/wxWidgets-3.1.1.
- Precondition:
HighSurrogate (value)
Returns the high surrogate code unit for the supplementary character.
- Parameters:
value (wx.int) – The Unicode code point of the character.
- Return type:
wx.Uint16
Added in version 4.1/wxWidgets-3.1.1.
- Precondition:
- IsAscii(self)¶
Returns
True
if the character is anASCII
character (i.e. if its value is less than 128).- Return type:
bool
- IsBMP(self, *args, **kw)¶
-
IsBMP (self)
Returns
True
if the character is aBMP
character (i.e. if its value is less than 0x10000).- Return type:
bool
Added in version 4.1/wxWidgets-3.1.1.
IsBMP (value)
Returns
True
if the character is aBMP
character (i.e. if its value is less than 0x10000).- Parameters:
value (wx.int) – The Unicode code point of the character.
- Return type:
bool
Added in version 4.1/wxWidgets-3.1.1.
- IsSupplementary(self, *args, **kw)¶
-
IsSupplementary (self)
Returns
True
if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).- Return type:
bool
Added in version 4.1/wxWidgets-3.1.1.
IsSupplementary (value)
Returns
True
if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).- Parameters:
value (wx.int) – The Unicode code point of the character.
- Return type:
bool
Added in version 4.1/wxWidgets-3.1.1.
- LowSurrogate(self, *args, **kw)¶
-
LowSurrogate (self)
Returns the low surrogate code unit for the supplementary character.
- Return type:
wx.Uint16
Added in version 4.1/wxWidgets-3.1.1.
- Precondition:
LowSurrogate (value)
Returns the low surrogate code unit for the supplementary character.
- Parameters:
value (wx.int) – The Unicode code point of the character.
- Return type:
wx.Uint16
Added in version 4.1/wxWidgets-3.1.1.
- Precondition:
Properties¶