[Python] How to parse Word files with Hindi text in KrutiDev font using Python in json

Discussão em 'Python' iniciado por Stack, Novembro 25, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to parse Word files .docx that contain Hindi text written in the KrutiDev 010 font. When I process the text using Python and try to encode it into JSON, I get random gibberish instead of the expected Hindi text.

    Here’s what I’ve done so far:


    1. I used the ensure_ascii=False parameter in the json.dump() function to allow Unicode encoding, as Python's JSON encoder uses ASCII by default.


    2. Despite this, the output is still incorrect and doesn't display the Hindi text properly.

    I suspect this issue is related to the KrutiDev font. when I put that gibberish in this convertor it give me correct Hindi text:

    krutidev to unicode converter

    How can I correctly parse and encode the Hindi text in KrutiDev font into Unicode and save in JSON files?

    Are there any Python libraries or methods to handle such font-specific encodings effectively?

    Continue reading...

Compartilhe esta Página