diff --git a/validators.go b/validators.go index bf3266813..41be94b26 100644 --- a/validators.go +++ b/validators.go @@ -420,6 +420,7 @@ func (v *validator) isAlphanumeric(s string) error { // Specific characters that are accepted switch r { case + 0xA0, //   - Non-breaking Space 0xA2, // ¢ - Cent Sign 0xAC, // ¬ - Negation 0xA6, // ¦ - Pipe diff --git a/validators_test.go b/validators_test.go index 69bafa06b..d3367d6b8 100644 --- a/validators_test.go +++ b/validators_test.go @@ -167,7 +167,7 @@ func TestValidators__isAlphanumeric(t *testing.T) { shouldError := tt.shouldErr(i) switch chr { - case `¢`, `¦`, `¬`, `±`: // skip valid ASCII characters + case ` `, `¢`, `¦`, `¬`, `±`: // skip valid ASCII characters continue case `Ø`: // skip characters found in real world usage