Quote:
Originally Posted by hihohahi
I have similar issue but with Arabic numbers. They randomly show up in my epub. I don't know any way to solve it so I made a simple macro AHK script and just run it every file.
|
You can do it with a "replace all" and a simple regex-functon:
Code:
search:
[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669]
Replace:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
str_in = '\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669'
str_out = '0123456789'
table = str.maketrans(str_in, str_out)
return match[0].translate(table)