jwaliszko / ExpressiveAnnotations

Annotation-based conditional validation library.
MIT License
351 stars 123 forks source link

Problem wit german letters ä,ö,ü #100

Closed madrianr closed 8 years ago

madrianr commented 8 years ago

There is a problem with german letters ä,ö,ü in column names - see picture i.e Column Name = Zustimmungserklärung

error

robert

jwaliszko commented 8 years ago

It's by design, currently only alphanumeric characters are allowed for func literals, see readme and code. Regards

madrianr commented 8 years ago

Is it possible to extend the solution to support these characters?

robert

jwaliszko commented 8 years ago

This is possible, but not in the scope for now. If this is to be implemented, not only these characters should be supported, but the whole set defined by C# specification, or some slightly, yet reasonably, simplified subset (e.g. see also this, or this answer). Because only alphanumeric characters are supported, the current regex is simple and usage case is clearly defined. Also, if more characters are to be supported, the client-side should obviously work with all of them as well.

madrianr commented 8 years ago

I think it is a important extension for all languages with special characters...

robert

jwaliszko commented 8 years ago

I do not agree it is that important. Unless you're writing code for yourself, it should be written in English.

Imagine this library is written in some other language, and due to that, e.g. AssertThat attribute is defined not as public class AssertThat { ... }, but as e.g. public class それをアサート { ... }. I've picked up Japanese letters as an example here, because I've just started to learn this amazing language.

BTW: You can obviously use any characters in string literals, e.g. AssertThat("SomeProperty == 'äöüß'").

madrianr commented 8 years ago

OK - my problem is that in the underlaying database some fields are used with this "special" chars (not special für germans) and that is why I cannot use your library in that database... robert

jwaliszko commented 8 years ago

Now it's clear, the code has been automatically reverse-engineered based on existing database schema.

madrianr commented 8 years ago

Yes and we have a lot of such DB's and the main CRM DB is that one which I have to migration from a Desktop App to a MVC App and there are a lot of Column names with ä,ü,ö...

jwaliszko commented 8 years ago

Unicode identifiers support added: https://github.com/jwaliszko/ExpressiveAnnotations/commit/1b5eb0d5cf47653222d3240d28b3c11bc8ba4d62. To be shipped with next release - v2.6.7.