Badaro / MTGODecklistCache

Cache in JSON format of tournaments posted on MTGO, Manatraders, Melee and Topdeck Websites
34 stars 4 forks source link

Review Normalization Code for Invasion of Kaladesh #33

Closed Badaro closed 1 year ago

Badaro commented 1 year ago

Invasion of Kaladesh // Aetherwing, Golden-Scale Flagship got added to scryfall today, and it broke the normalization code due to a very unexpected behavior of InvariantCultureIgnoreCase in .Net.

bool test1 = String.Equals("Aether", "Æther");                                              // false
bool test2 = String.Equals("Aether", "Æther", StringComparison.InvariantCultureIgnoreCase); // true

I applied a workaround, but a proper fix will require a rewrite of the normalizer code because this card requires a combination of the "Aether" normalization fixes with the standard DFC/Split cards normalization.

Badaro commented 1 year ago

Should also take the opportunity to add write tests for the Normalizer.