.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.UniChar:

==========================================================================================================================================
|phoenix_title|  **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| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>UniChar</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.UniChar_inheritance.png" alt="Inheritance diagram of UniChar" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.UniChar.html" title="wx.UniChar" alt="" coords="5,5,103,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.UniChar.__init__`                                                     
:meth:`~wx.UniChar.GetAsChar`                                                    Returns ``True`` if the character is representable as a single byte in the current locale encoding.
:meth:`~wx.UniChar.GetValue`                                                     Returns Unicode code point value of the character.
:meth:`~wx.UniChar.HighSurrogate`                                                Returns the high surrogate code unit for the supplementary character.
:meth:`~wx.UniChar.IsAscii`                                                      Returns ``True`` if the character is an ``ASCII`` character (i.e. if its value is less than 128).
:meth:`~wx.UniChar.IsBMP`                                                        Returns ``True`` if the character is a ``BMP`` character (i.e. if its value is less than 0x10000).
:meth:`~wx.UniChar.IsSupplementary`                                              Returns ``True`` if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).
:meth:`~wx.UniChar.LowSurrogate`                                                 Returns the low surrogate code unit for the supplementary character.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.UniChar.Value`                                                        See :meth:`~wx.UniChar.GetValue`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.UniChar(object)

   **Possible constructors**::

       UniChar(c)
       
       UniChar(c)
       
   
   This class represents a single Unicode character.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, c)`
      
      
      
      
      :param `c`: 
      :type `c`: long
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, c)`
      
      
      
      
      :param `c`: 
      :type `c`: long
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: 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 returns ``True`` for 7 bit ``ASCII`` characters when the encoding used is ``UTF-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. 




      :param `c`: An output pointer to the value of this Unicode character as a  ``char`` . Must be non-NULL.    
      :type `c`: int






      :rtype: `bool`



                  



      :returns: 

         ``True`` if the object is an 8 bit int and `c`  was filled with its value as int or ``False`` otherwise (`c`  won't be modified then).  







      .. versionadded:: 2.9.1 
     







      .. seealso:: :meth:`IsAscii`   








   .. method:: GetValue(self)

      Returns Unicode code point value of the character.                  

      :rtype: `value_type`








   .. method:: HighSurrogate(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **HighSurrogate** `(self)`
      
      Returns the high surrogate code unit for the supplementary character.                  
      
                      
      
      :rtype: :ref:`wx.Uint16`
      
      
      
      
      
      
      
      .. versionadded:: 4.1/wxWidgets-3.1.1  
           
      
      
      
      
      
      
      
      :precondition: :meth:`IsSupplementary`   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **HighSurrogate** `(value)`
      
      Returns the high surrogate code unit for the supplementary character.                  
      
      
      
      
      :param `value`: The Unicode code point of the character.  
      :type `value`: wx.int
      
      
      
      
      
      
      :rtype: :ref:`wx.Uint16`
      
      
      
                        
      
      
      
      .. versionadded:: 4.1/wxWidgets-3.1.1  
           
      
      
      
      
      
      
      
      :precondition: :meth:`IsSupplementary`   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: IsAscii(self)

      Returns ``True`` if the character is an ``ASCII`` character (i.e. if its value is less than 128).                  

      :rtype: `bool`








   .. method:: IsBMP(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **IsBMP** `(self)`
      
      Returns ``True`` if the character is a ``BMP`` character (i.e. if its value is less than 0x10000).                  
      
                      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      .. versionadded:: 4.1/wxWidgets-3.1.1  
           
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **IsBMP** `(value)`
      
      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.  
      :type `value`: wx.int
      
      
      
      
      
      
      :rtype: `bool`
      
      
      
                        
      
      
      
      .. versionadded:: 4.1/wxWidgets-3.1.1  
           
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: IsSupplementary(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **IsSupplementary** `(self)`
      
      Returns ``True`` if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).                  
      
                      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      .. versionadded:: 4.1/wxWidgets-3.1.1  
           
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **IsSupplementary** `(value)`
      
      Returns ``True`` if the character is a supplementary character (i.e. between 0x10000 and 0x10FFFF).                  
      
      
      
      
      :param `value`: The Unicode code point of the character.  
      :type `value`: wx.int
      
      
      
      
      
      
      :rtype: `bool`
      
      
      
                        
      
      
      
      .. versionadded:: 4.1/wxWidgets-3.1.1  
           
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: LowSurrogate(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **LowSurrogate** `(self)`
      
      Returns the low surrogate code unit for the supplementary character.                  
      
                      
      
      :rtype: :ref:`wx.Uint16`
      
      
      
      
      
      
      
      .. versionadded:: 4.1/wxWidgets-3.1.1  
           
      
      
      
      
      
      
      
      :precondition: :meth:`IsSupplementary`   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **LowSurrogate** `(value)`
      
      Returns the low surrogate code unit for the supplementary character.                  
      
      
      
      
      :param `value`: The Unicode code point of the character.  
      :type `value`: wx.int
      
      
      
      
      
      
      :rtype: :ref:`wx.Uint16`
      
      
      
                        
      
      
      
      .. versionadded:: 4.1/wxWidgets-3.1.1  
           
      
      
      
      
      
      
      
      :precondition: :meth:`IsSupplementary`   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. attribute:: Value

      See :meth:`~wx.UniChar.GetValue`

