3

I have a file that has so many persian/arabic digits in it. I would like to replace them with their English counterparts. How is that possible?

1 Answer 1

3

Use the following :s command for Persian and Urdu digits:

:%s/\([۰-۹]\)/\=char2nr(submatch(1))-1776/g

And the following for Arabic digits:

:%s/\([۰-۹]\)/\=char2nr(submatch(1))-1536/g
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.