How to determine a string is English or Persian?

后端 未结 5 919
南笙
南笙 2021-01-11 17:45

I have edittext in a form, I want that when the user inputs text into the edittext for my program to detect which language was inserted into the edittext.

Is there a

5条回答
  •  清酒与你
    2021-01-11 18:12

    All possible Unicode ranges for Persian (also for Urdu) alphabet:

    • 0x0600 to 0x06FF

    • 0xFB50 to 0xFDFF

    • 0xFE70 to 0xFEFF

      So if you want don't miss any char check all ranges. Hope helps you.

提交回复
热议问题