comparison genshi/output.py @ 932:e53161c2773c

Merge r1140 from py3k: add support for python 3 to core genshi components (genshi.core, genshi.input and genshi.output): * default input and output encodings changed from UTF-8 to None (i.e. unicode strings) * Namespace and QName objects do not call stringrepr in __repr__ in Python 3 since repr() returns a unicode string there. * track changes to expat parser in Python 3 (mostly it accepts bytes instead of strings)
author hodgestar
date Fri, 18 Mar 2011 09:08:12 +0000
parents 72d56a8441e8
children
comparison
equal deleted inserted replaced
931:ade3abe742e9 932:e53161c2773c
25 __all__ = ['encode', 'get_serializer', 'DocType', 'XMLSerializer', 25 __all__ = ['encode', 'get_serializer', 'DocType', 'XMLSerializer',
26 'XHTMLSerializer', 'HTMLSerializer', 'TextSerializer'] 26 'XHTMLSerializer', 'HTMLSerializer', 'TextSerializer']
27 __docformat__ = 'restructuredtext en' 27 __docformat__ = 'restructuredtext en'
28 28
29 29
30 def encode(iterator, method='xml', encoding='utf-8', out=None): 30 def encode(iterator, method='xml', encoding=None, out=None):
31 """Encode serializer output into a string. 31 """Encode serializer output into a string.
32 32
33 :param iterator: the iterator returned from serializing a stream (basically 33 :param iterator: the iterator returned from serializing a stream (basically
34 any iterator that yields unicode objects) 34 any iterator that yields unicode objects)
35 :param method: the serialization method; determines how characters not 35 :param method: the serialization method; determines how characters not
Copyright (C) 2012-2017 Edgewall Software