Latest Version: 0.9.6.2

UnicodeString

Converts things to unicode string, this is a specialization of the String class.

In addition to the String arguments, an encoding argument is also accepted. By default the encoding will be utf-8.

All converted strings are returned as Unicode strings.

>>> UnicodeString().to_python(None)
''
>>> UnicodeString().to_python([])
u''
>>> UnicodeString(encoding='utf-7').to_python('Ni Ni Ni')
u'Ni Ni Ni'

Messages

badEncoding:
Invalid data or incorrect encoding
badType:
The input must be a string (not a %(type)s: %(value)r)
empty:
Please enter a value
noneType:
The input must be a string (not None)
tooLong:
Enter a value less than %(max)i characters long
tooShort:
Enter a value %(min)i characters long or more

Attributes

a __singletonmethods__

('to_python', 'from_python')

a accept_python

True

a compound

False

a encoding

'utf-8'

a max

None

a min

None

a not_empty

None

a repeating

False

a strip

False

Methods

f __call__(self, *args, **kw) ...

f __classinit__(cls, new_attrs) ...

f __classsourcerepr__(cls, source, binding=None) ...

f __init__(self, inputEncoding=None, outputEncoding=None, **kw) ...

f __initargs__(self, new_attrs) ...

f __sourcerepr__(self, source, binding=None) ...

f empty_value(self, value) ...

f validate_python(self, value, state) ...

See the source for more information.

Top