1

Closed

Rules : Input string was not in a correct format.

description

Was processing the latest downloaded TZ files and ran into an issue with the rules for Morocco ... several of the lines could not be processed ... not sure if it had extra spaces or tabs, but it the array got too large and it couldn't parse out the time value correctly (it was constantly one less in the index position).

Was wondering if anyone else had this issue ?

Morocco 2013 only - Jul 9 3:00 0 -
Morocco 2013 only - Aug 8 2:00 1:00 S
Morocco 2016 only - Jun 7 3:00 0 -
Morocco 2016 only - Jul 7 2:00 1:00 S
Morocco 2019 only - May 6 3:00 0 -
Morocco 2019 only - Jun 5 2:00 1:00 S
Morocco 2022 only - May 3 2:00 1:00 S
Closed Oct 19, 2013 at 11:20 PM by abfo

comments

pawaw wrote Apr 9, 2013 at 6:34 AM

We have replaced the following code:
        public Rule(string line)
        {
            // Parse the string
            string[] arr = line.Split('\t', ' ');
With this:
        public Rule(string line)
        {
            // Parse the string
            string[] arr = line.Split(new char[]{'\t', ' '}, StringSplitOptions.RemoveEmptyEntries);

wrote Oct 19, 2013 at 11:20 PM