My S005_179-205M-2 formatted XML file:
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:base="http://example.org" xml:id="example_v1" >
<teiHeader>
<fileDesc>
<titleStmt>
<title>test</title>
</titleStmt>
<publicationStmt>
<p>test</p>
</publicationStmt>
<sourceDesc>
<p>test</p>
</sourceDesc>
</fileDesc>
</teiHeader>
<text xml:lang="ar">
<body>
<div type="chapter" n="5" xml:lang="ar">
<div type="section" n="5.179">
<head type="30">الْقَوْلُ فِي تَأْوِيلِ قَوْلِهِ : <quote type="quran" n="5:74">أَفَلا يَتُوبُونَ إِلَى اللَّهِ وَيَسْتَغْفِرُونَهُ وَاللَّهُ غَفُورٌ رَحِيمٌ </quote></head>
<p n="nothadith" ana="adyan kalam yes">يقول تعالى ذكره : أفلا يرجع هذان الفريقان <name
role="organization">الكافران</name> ، القائل أحدهما : <quote
type="quran" n="5:72">إِنَّ اللَّهَ هُوَ <name role="person">الْمَسِيحُ
ابْنُ مَرْيَمَ</name>
</quote> ، والآخر القائل : <quote type="quran" n="5:73">إِنَّ اللَّهَ
ثَالِثُ ثَلاثَةٍ </quote> ، عما قالا من ذلك ، و ينيبان مما قالا ونطقا به
من كفرهما ، ويسألان ربهما المغفرة مما قالا : <quote type="quran" n="5:74"
>وَاللَّهُ غَفُورٌ </quote> ، لذنوب التائبين من خلقه ، المنيبين إلى <pb
type="turki" n="8:582"/> طاعته بعد معصيتهم ، <quote type="quran"
n="5:34">رَحِيمٌ </quote> بهم في قبوله توبتَهم ، ومراجعتَهم إلى ما يحب
مما يكره ، فيصفح بذلك من فعلهم عما سلف من إجرامهم قبل ذلك . </p>
</div>
</div>
</body>
</text>
</TEI>
reading file by following command :
from lxml import etree
tree = etree.parse('S005_179-205M-2 formated.xml')
printing the tree by
root = tree.getroot()
print(etree.tostring(root))
Output file looks like
It should print in the Arabic language. I have checked the parser is not reading in Arabic. How can I make sure that the parser parses using Unicode?
