[Lucene.Net] [jira] [Commented] (LUCENENET-85) SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator
[ https://issues.apache.org/jira/browse/LUCENENET-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13009691#comment-13009691 ] Robert Jordan commented on LUCENENET-85: IIRC, this was done on purpose to remain index-compatible with Java Lucene. SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator -- Key: LUCENENET-85 URL: https://issues.apache.org/jira/browse/LUCENENET-85 Project: Lucene.Net Issue Type: Bug Reporter: Digy Assignee: George Aroush Priority: Minor Attachments: SupportClass.patch Again System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator problem public static System.Single Parse(System.String s) { try { if (s.EndsWith(f) || s.EndsWith(F)) return System.Single.Parse(s.Substring(0, s.Length - 1).Replace(., System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); else return System.Single.Parse(s.Replace(., System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); } catch(System.FormatException fex) { throw fex; } } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[Lucene.Net] [jira] [Commented] (LUCENENET-85) SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator
[ https://issues.apache.org/jira/browse/LUCENENET-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13009628#comment-13009628 ] Sergey Mirvoda commented on LUCENENET-85: - Why invariant culture? You should always use CurrentCulture or require cultureInfo as a parameter. If you use invariant culture you will fail with parsing _any_ culture specific strings for example in Russia ,(not .) is a decimal separator. and I also think that method above is wrong. SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator -- Key: LUCENENET-85 URL: https://issues.apache.org/jira/browse/LUCENENET-85 Project: Lucene.Net Issue Type: Bug Reporter: Digy Assignee: George Aroush Priority: Minor Attachments: SupportClass.patch Again System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator problem public static System.Single Parse(System.String s) { try { if (s.EndsWith(f) || s.EndsWith(F)) return System.Single.Parse(s.Substring(0, s.Length - 1).Replace(., System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); else return System.Single.Parse(s.Replace(., System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); } catch(System.FormatException fex) { throw fex; } } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[Lucene.Net] [jira] [Commented] (LUCENENET-85) SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator
[ https://issues.apache.org/jira/browse/LUCENENET-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13009637#comment-13009637 ] Sergej Koščejev commented on LUCENENET-85: -- As far as I can tell, the methods in SupportClass are used to convert between doubles and strings for indexing purposes. This conversion should always happen in the same way, independent of the current culture. SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator -- Key: LUCENENET-85 URL: https://issues.apache.org/jira/browse/LUCENENET-85 Project: Lucene.Net Issue Type: Bug Reporter: Digy Assignee: George Aroush Priority: Minor Attachments: SupportClass.patch Again System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator problem public static System.Single Parse(System.String s) { try { if (s.EndsWith(f) || s.EndsWith(F)) return System.Single.Parse(s.Substring(0, s.Length - 1).Replace(., System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); else return System.Single.Parse(s.Replace(., System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); } catch(System.FormatException fex) { throw fex; } } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[Lucene.Net] [jira] [Commented] (LUCENENET-85) SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator
[ https://issues.apache.org/jira/browse/LUCENENET-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13009650#comment-13009650 ] Sergey Mirvoda commented on LUCENENET-85: - Not sure relevant this rule to lucene or not but. As for our team we always use following practice: If we need strings only for internal use _and_ client gives us real numbers - We always use InvariantCulture. If client gives us numbers as strings - We always use CurrentCulture or parameter. SupportClass.Parse and System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator -- Key: LUCENENET-85 URL: https://issues.apache.org/jira/browse/LUCENENET-85 Project: Lucene.Net Issue Type: Bug Reporter: Digy Assignee: George Aroush Priority: Minor Attachments: SupportClass.patch Again System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator problem public static System.Single Parse(System.String s) { try { if (s.EndsWith(f) || s.EndsWith(F)) return System.Single.Parse(s.Substring(0, s.Length - 1).Replace(., System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); else return System.Single.Parse(s.Replace(., System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); } catch(System.FormatException fex) { throw fex; } } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira