Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for non-latin characters? #261

Closed
justinclift opened this issue Nov 29, 2016 · 8 comments
Closed

Support for non-latin characters? #261

justinclift opened this issue Nov 29, 2016 · 8 comments
Assignees
Labels
Milestone

Comments

@justinclift
Copy link

Looking at the available validation rules, there doesn't (yet) seem to be anything available for non-latin based character sets. eg Mandarin, Japanese, Thai (etc)

Is there a desire to get that included? (#239 seems relevant)

If so, Astaxie's Golang programming intro has a method to validate Chinese characters: https://github.com/astaxie/build-web-application-with-golang/blob/c672edb3255b907296d7d8153038b839034da54d/en/04.2.md#chinese
(might be worth incorporating)

No idea about similar for other languages yet, but it might be a useful start.

Asking because I'm looking for a validation approach for valid Unicode characters (for display of names), thus looking around. 😉

Package version eg. v8, v9:

v9

Issue, Question or Enhancement:

Enhancement

@deankarn deankarn added this to the v9 milestone Nov 29, 2016
@deankarn deankarn self-assigned this Nov 29, 2016
@deankarn
Copy link
Contributor

Hey @justinclift

alpha & alphanum should be the only validations that do not support latin characters that could/should(if not let me know) and yes I am interested in including 2 more validations.

I would like to add unicodealpha and unicodealphanum to accept unicode characters, can't break the current validations, the only thing is that the regex in #239 not only accepts unicode characters but also symbols which is probably not desired.

I am completely open to a pull request to add the above validations(or any other validations) as long as they only accept characters and alphanumeric characters; it's on my list of things to do but don't know when I'll get to it. Any help would be appreciated 😄 validations are pretty easy to add, it's all the tests to add that takes a bit.

if you are also referring to actual name validation mentioned in #239, as I had mentioned this is a very subjective and case-by-case thing, however, I have been thinking of creating another repo(or perhaps a subfolder/subpackage in this one) to hold validations that are not in the core but are available to be easily registered if one wants to use them; what do you think?

@justinclift
Copy link
Author

Hmmm, there doesn't seem to be a validation for "is this a valid Unicode character string?" either, or am I not seeing something obvious?

@deankarn
Copy link
Contributor

Hey @justinclift

No you are not missing anything, as my previous comment mentioned, I would like to add them; they do not yet exist.

My time is just very limited right now and don't know when I can get to adding them, if someone could add them and make a pull request I'd merge it.

I will attempt to add these sometime this morning if I can find time.

@deankarn
Copy link
Contributor

Hey @justinclift

I've added alphaunicode and alphanumunicode in Release 9.3.0

please let me know if this helps

@justinclift
Copy link
Author

Oohh thanks @joeybloggs, that definitely looks useful. I'll give that a shot, most likely tomorrow (brain dead atm).

@justinclift
Copy link
Author

It turns out I was getting ahead of myself, so it'll probably be at least a few days until I can try this out properly. 👼

@deankarn deankarn closed this as completed Mar 1, 2017
@justinclift
Copy link
Author

Sorry for the delay. Got distracted by other things.

No idea when I'll get around to testing this part of things myself. 😦

@deankarn
Copy link
Contributor

deankarn commented Mar 2, 2017

No worries I know how things can get busy 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants