Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Misc. Fixes

Help
2013-02-25
2013-04-29
  • Kevin Routley
    Kevin Routley
    2013-02-25

    I'm using GEDCOM.Net to provide more complete GEDCOM parsing in my project, Family Lines (see http://familylines.codeplex.com/). So far, GEDCOM.Net has proven to be quite a bit faster and more complete than the original parsing code.

    I've run into a few problems parsing some GED files from the web. The issues, and my fixes, are added as replies.

     
  • Kevin Routley
    Kevin Routley
    2013-02-25

    In AnselEncoding.cs, I ran into a length/off-by-one problem. I have a hack fix in place but don't yet understand the "real" issue.
    In AnselEncoding.cs, GetChars(), at line 420, change these lines:
    chars = (char)ucs_;
    combine = true;
    to:
                                if (charIndex + 1 < chars.Length)
                                {
                                    chars = (char) ucs;
                                    combine = true;
                                }
    _

     
  • Kevin Routley
    Kevin Routley
    2013-02-25

    In GedcomRecordReader.cs, I encountered some GED files which had empty lines for the TEXT tag associated to SOURCE tags. This caused the parser to drop the TEXT. In ReadSourceRecord(), at line 3099, change this line:

                            if (_lineValueType == GedcomLineValueType.DataType)
    

    to:

                            if (_lineValueType != GedcomLineValueType.PointerType)
    
     
  • Kevin Routley
    Kevin Routley
    2013-02-25

    I encountered a number of GED files that stated their encoding was "ASCII". They were in fact 8-bit ASCII, but StreamReader treats "ASCII" as 7-bit not 8-bit.

    My "fix" for this in GedcomReader.cs was to treat "ASCII" the same as "ANSI". In ReadHeaderRecord(), at line 1063, disable the existing "ASCII" case and add it together with "ANSI" at line 1050, as follows:

    case "ANSI":
    case "ASCII":
    
     
  • Kevin Routley
    Kevin Routley
    2013-02-25

    In GedcomDate.cs, I found it helpful to have CompareByDate() have support for null parameters. Change lines 413-414 to:

            public static int CompareByDate(GedcomDate datea, GedcomDate dateb)
            {
                if (datea == null)
                {
                    if (dateb == null)
                        return 0;
                    return -1;
                }
                if (dateb == null)
                    return 1;
    
     
  • Kevin Routley
    Kevin Routley
    2013-02-25

    GedcomDate.cs cannot be used to parse more than one date string using a single instance. Namely, once the DatePeriod is set for a parse, all subsequent parses will be "stuck" with that DatePeriod value. In GedcomDate.cs, ParseDateString, before line 538, I added:

    DatePeriod = GedcomDatePeriod.Exact;
    
     
  • Kevin Routley
    Kevin Routley
    2013-02-25

    An editorial comment, as I don't yet have a fix. GedcomDate does not handle B.C. dates:

    - a "B.C." trailer is parsed, but is thrown away
    - the use of DateTime precludes support for B.C. as the DateTime class MinValue is 1 A.D.