Changeset 390 for trunk/genshi/input.py
- Timestamp:
- Oct 24, 2006, 5:52:57 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/genshi/input.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/genshi/input.py
r386 r390 76 76 _external_dtd = '\n'.join(_entitydefs) 77 77 78 def __init__(self, source, filename=None ):78 def __init__(self, source, filename=None, encoding=None): 79 79 """Initialize the parser for the given XML input. 80 80 81 81 @param source: the XML text as a file-like object 82 82 @param filename: the name of the file, if appropriate 83 @param encoding: the encoding of the file; if not specified, the 84 encoding is assumed to be ASCII, UTF-8, or UTF-16, or whatever the 85 encoding specified in the XML declaration (if any) 83 86 """ 84 87 self.source = source … … 86 89 87 90 # Setup the Expat parser 88 parser = expat.ParserCreate( 'utf-8', '}')91 parser = expat.ParserCreate(encoding, '}') 89 92 parser.buffer_text = True 90 93 parser.returns_unicode = True
Note: See TracChangeset
for help on using the changeset viewer.
