-
Notifications
You must be signed in to change notification settings - Fork 39
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
Floating point values are converted with cultural settings #43
Comments
Thanks for the info. I'll look into it and try and include a fix in the next release. |
The URI Template class handles strings, IEnumerable and IDictionary<string,string>. When the parameter is not one of those types, we simply call object.ToString(). Unfortunately, that method doesn't have a Culture property. If we can identify which types need to be special cased, and that set of types covers a large enough set of cases, then we could add handling for that. However, this is a can of worms. I'm sort of wishing I had stuck with my original idea of requiring parameters to be explicitly converted to strings by the application before providing them to URI template. |
Actually I've solved applying this simple workaround to value |
@darrelmiller we could start with all the number and date based types, that is:
by adding a switch expression based on type inference here what do you think? |
For example, the double in some countries (as mine) is converted to string with a comma ',' instead of a dot '.' between integer and decimal digits, and encoding url it is converted to
%2C
.This is an issue because decoding value first it is received as an array of two integers, and not in every context I can parse values before than they are decoded.
The text was updated successfully, but these errors were encountered: