-
Notifications
You must be signed in to change notification settings - Fork 124
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
Bug: Property mapping fails with Turkish locale #502
Comments
Thanks @mertkokusen. I would assume your stacktrace is different from the root cause you mentioned. Can you paste the exception here? Or, a very small steps to replicate it would be very great. Thanks! |
Unfortunately, there is no exception, just the properties that contain letter I are not filled with values from the DB. I cloned RepoDB and ran tests with RepoDb.Sqlite solution (in in-memory mode). Initially QueryTests were failing I replaced all ToLower calls with ToLowerInvariant and all tests in QueryTests are passing. I have experienced this problem with other libraries in the last couple of years because in Turkish uppercase i is İ and lowercase I is ı, which causes lots of headaches. Running tests on a machine with windows installed in turkish should reproduce the issue. |
@mertkokusen - thank you for the clarity. Will do cover this on my next release. |
@mikependon thanks |
@mertkokusen - would you be able to issue a PR in relation to this? It is much better actually, specially you already cloned it to your machine and had made the tests passed there. I will do cover all the other needed tests. Thanks in advance! Please do let me know if you can make it. |
@mikependon sure I will make a PR :) |
@mikependon made the PR |
Big Thanks. I am in a middle of refactoring the core compiler of RepoDb. I will handle the case of FunctionFactory.cs, would it be possible to exclude it from your PR? Lastly, can you also handle the |
@mikependon Sure I will exclude FunctionFactory.cs (the one in RepoDb.Core solution). But excluding this file results in some tests failing. Is it ok like this? |
Thanks. I know that the For the failing tests, I guess it is OK. It will only fail in your side due to locale, but once I committed the changes in the Hope this helps. |
I took the info from here |
Use the ToLowerInvariant instead of ToLower. Fixes the #502
That is correct, that makes the string comparisson slower. But would not it unresolving the special chars automatically? In anyway, for as long your PR is working your local machine, then that is enough. I will make sure to handle the core compiler changes. Thanks for the PR |
The fix is now available at RepoDb v1.12.0-beta4 and RepoDb.SqlServer v1.1.0-beta2. > Install-Package RepoDb -version 1.12.0-beta4
> Install-Package RepoDb.SqlServer -version 1.1.0-beta2 We are closing this ticket now. Kindly let us know if you still have questions. |
Thanks for this library, it really has everything I was missing with other micro ORMs.
Property names that contain uppercase letter "I" causes property mapping to fail on some machines because of culture (ex. on a machine with turkish windows). using ToLowerInvariant instead of ToLower in resolvers solves this issue.
The text was updated successfully, but these errors were encountered: