I'm looking for a function to test if a given string contains only (thanks @meagar) characters in given language. The sample string is UTF-8; the additional argument can be anything (I imagine it however working with locale strings). It shouldn't return true for any non-alphabetic characters.
As such the output of such function should be:
test("jérôme", "FR_fr") = true
test("jérôme", "PL_pl") = false
test("jrme", "FR_fr") = true
test("jrme", "PL_pl") = true
test("***hi***", "PL_pl") = false
I'm looking for a generic function - as: it should work for any valid locales, be it: FR_fr, PL_pl, GD_ie or ZH_cn.
Any ideas?
edit: valid point by @deceze - let's change this from [language] to [alphabet]