Package dbus :: Class UTF8String
[hide private]
[frames] | no frames]

Class UTF8String

source code

     object --+            
              |            
     basestring --+        
                  |        
                str --+    
                      |    
_dbus_bindings._StrBase --+
                          |
                         UTF8String

A string represented using UTF-8 - a subtype of str.

All strings on D-Bus are required to be valid Unicode; in the "wire protocol" they're transported as UTF-8.

By default, when byte arrays are converted from D-Bus to Python, they come out as a dbus.String, which is a subtype of unicode. If you prefer to get UTF-8 strings (as instances of this class) or you want to avoid the conversion overhead of going from UTF-8 to Python's internal Unicode representation, you can pass the utf8_strings=True keyword argument to any of these methods:

Constructor:

dbus.UTF8String(value: str or unicode[, variant_level: int]) -> UTF8String

If value is a str object it must be valid UTF-8.

variant_level must be non-negative; the default is 0.




Since: 0.80 (in older versions, use dbus.String)

Instance Methods [hide private]
 
__new__(T, S, ...)
Returns: a new object with type S, a subtype of T
source code

Inherited from _dbus_bindings._StrBase: __delattr__, __getattribute__, __repr__, __setattr__

Inherited from str: __add__, __contains__, __eq__, __ge__, __getitem__, __getnewargs__, __getslice__, __gt__, __hash__, __le__, __len__, __lt__, __mod__, __mul__, __ne__, __rmod__, __rmul__, __str__, capitalize, center, count, decode, encode, endswith, expandtabs, find, index, isalnum, isalpha, isdigit, islower, isspace, istitle, isupper, join, ljust, lower, lstrip, partition, replace, rfind, rindex, rjust, rpartition, rsplit, rstrip, split, splitlines, startswith, strip, swapcase, title, translate, upper, zfill

Inherited from object: __init__, __reduce__, __reduce_ex__

Instance Variables [hide private]
int variant_level
Indicates how many nested Variant containers this object is contained in: if a message's wire format has a variant containing a variant containing a string, this is represented in Python by a String or UTF8String with variant_level==2.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(T, S, ...)

source code 
Returns:
a new object with type S, a subtype of T

Overrides: _dbus_bindings._StrBase.__new__