Uploaded image for project: 'Lucene.Net'
  1. Lucene.Net
  2. LUCENENET-493

Make lucene.net culture insensitive (like the java version)

    XMLWordPrintableJSON

Details

    Description

      In Java, conversion of the basic types to and from strings is locale (culture) independent. For localized input/output one needs to use the classes in the java.text package.
      In .Net, conversion of the basic types to and from strings depends on the default Culture. Otherwise you have to specify CultureInfo.InvariantCulture explicitly.

      Some of the testcases in lucene.net fail if they are not run on a machine with culture set to US.
      In the current version of lucene.net there are patches here and there that try to correct for some specific cases by using string replacement (like System.Double.Parse(s.Replace(".", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)), but that seems really ugly.

      I submit a patch here that removes the old workarounds and replaces them by calls to classes in the Lucene.Net.Support namespace that try to handle the conversions in a compatible way.

      Attachments

        1. Lucenenet-493.patch
          29 kB
          Luc Vanlerberghe
        2. UpdatedLocalizedTestCase.patch
          10 kB
          Christopher Calvin Currens

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lvl Luc Vanlerberghe
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: