How to detect language of text?
问题 I have a form which lets users input text snippets. So how can figure out the language of the entered text? Specifically these languages for now: Arabic: هذه هي بعض النصوص العربية Chinese: 这是一些阿拉伯文字 Japanese: これは、いくつかのアラビア語のテキストです [Edit] The detection has work on text which is retrieved via an API too (no browser involved) 回答1: You can figure out whether the characters are from the Arabic, Chinese, or Japanese sections of the Unicode map. If you look at the list on Wikipedia, you'll see that