Skip to content
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

Enumeration values should be treated as case-insensitive #6

Open
FlorianCassayre opened this issue Jul 19, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@FlorianCassayre
Copy link
Member

The Gedcom specification version 5.5.5 page 54 says the following regarding enumerations:

All controlled line_value choices (enumerated values) are case-insensitive. The values "Feb", "FEB" and "feb" are considered equal. A GEDCOM reader must convert all such values to all-uppercase or all-lowercase prior to comparing to internally defined values.

Currently the parser does not make such a distinction and would not properly handle enumeration value that are expressed in lowercase (the date parser partially solves this problem, but not completely).

The proposition is to normalize values to uppercase:

  • Locally and systematically when using value parsers
  • By calling a special method for simple values, e.g. valueAsEnumeration
@FlorianCassayre FlorianCassayre added the bug Something isn't working label Jul 19, 2022
@FlorianCassayre FlorianCassayre self-assigned this Jul 19, 2022
@FlorianCassayre
Copy link
Member Author

Turns out what is considered an enumeration appears to be ambiguous: https://www.tamurajones.net/TheGEDCOMDATECase.xhtml

The safest option would be to consider all Value*.ts as enumerations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant