-
Regarding the Alpha Validation rules, the Laravel documentation states
And the actual implementation logic is as follows public function validateAlpha($attribute, $value)
{
return is_string($value) && preg_match('/^[\pL\pM]+$/u', $value);
} According to the distribution map in this Wikipedia(List of Unicode characters) , the characters in However, the common "alphabet" in Japan refers to the 26 letters used in English, from A-Z. As a reference, the authoritative Japanese dictionary "Kojien" defines the alphabet as follows
As far as I know, most Japanese people take "alphabet" in the second sense. In short, when Japanese hear "The field under validation must be entirely alphabetic characters.", they imagine a rule equivalent to "a-zA-Z". I submitted a PR like #45609, but it was closed. Based on the possibility that many Japanese may use this validation rule with a misunderstanding, we believe that we should at least warn them in the document. Similar issues and PRs have been filed in the past, but there seems to be no resolution. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
I can not imagine how the people thinks about that who speaks English as the mother tongue; Do the people really think that the "Alphabetic characters" means the full set of alphabetical characters including Kana and so on defined in the Unicode? |
Beta Was this translation helpful? Give feedback.
-
It should be considered that there are indispensable divergence between the strict Unicode definition and the nuances that are imagined in everyday life. Laravel is not a tool for academics, but a Web framework used more broadly by the masses. |
Beta Was this translation helpful? Give feedback.
-
@taylorotwell @driesvints @nunomaduro @doshu @hmingv @joelclermont I would like to mention for the maintainers and related issue participants, thank you for your time. Any opinions? |
Beta Was this translation helpful? Give feedback.
-
My purpose is to let customers only enter a-zA-Z. "alphabetic" I will translate into "字母(letters)", in my concept it is the English alphabet, of course, I can give up the understanding of Chinese, it is "alphabetic". Just, if it covers a really wide range, why can't we use "words" to describe it. |
Beta Was this translation helpful? Give feedback.
-
I have read RFC2234 as a supplement to this. https://datatracker.ietf.org/doc/html/rfc2234#section-6.1 In my argument above, I was mainly talking about "how alphabets are regarded in a language area where multi-byte characters are commonly used, such as Japan", but looking at this RFC, it seems that ALPHA generally refers to the 26 characters of A-Z (or its upper case and lower case combined, 52 characters) even in the computer world. |
Beta Was this translation helpful? Give feedback.
-
#45769 |
Beta Was this translation helpful? Give feedback.
#45769
This PR was merged then we can use
alpha:ascii
rule with the option for strict validation!