Also this:
>>> docsrc = u'\ufeff<?xml version="1.0" encoding="us-ascii"?><root/>'.encode('utf-8') >>> lxml.etree.fromstring(docsrc) <Element root at 0x10c7c1ef0>
Because of the byte order marker '\ufeff', the document is not ascii.
Also this:
>>> docsrc = u'\ufeff<?xml version="1.0" encoding= "us-ascii" ?><root/ >'.encode( 'utf-8' ) fromstring( docsrc)
>>> lxml.etree.
<Element root at 0x10c7c1ef0>
Because of the byte order marker '\ufeff', the document is not ascii.