मैं थोड़ी देर के लिए इस के साथ संघर्ष कर रहा हूं। मैं HTML पर स्ट्रिंग लिखने की कोशिश कर रहा हूं लेकिन प्रारूप को साफ़ करने के बाद प्रारूपों के साथ समस्याएं हैं। यहाँ एक उदाहरण है:पायथन एचटीएमएल एन्कोडिंग xc2 xa0
paragraphs = ['Grocery giant and household name Woolworths is battered and bruised. ',
'But behind the problems are still the makings of a formidable company']
x = str(" ")
for item in paragraphs:
x = x + str(item)
x
आउटपुट:
"Grocery giant and household name\xc2\xa0Woolworths is battered and\xc2\xa0bruised.
But behind the problems are still the makings of a formidable\xc2\xa0company"
वांछित उत्पादन:
"Grocery giant and household name Woolworths is battered and bruised.
But behind the problems are still the makings of a formidable company"
मैं आशा करती हूं कि आप को समझाने के लिए कि ऐसा क्यों होता है और मैं कैसे ठीक कर सकते हैं कर रहे हैं। अग्रिम में धन्यवाद!
क्या आपने अपनी स्रोत स्ट्रिंग में असामान्य यूनिकोड व्हाइटस्पेस की जांच की है? –