MagicTheGathering / mtg-sdk-python

Magic: The Gathering SDK - Python
MIT License
255 stars 45 forks source link

Issue with Character Encoding in Card Text #40

Open mossday opened 10 months ago

mossday commented 10 months ago

I have been using the MTGSDK to fetch card data, particularly card text. However, I have encountered an issue with character encoding when fetching the card text using the MTGSDK. Specifically, certain characters like apostrophes (') are not being properly decoded in the fetched card text. This issue is consistently present across different sets and cards.

Steps to Reproduce:

  1. Use the MTGSDK to fetch card data, including card text.
  2. Inspect the fetched card text for characters like apostrophes (').

Expected Behavior: The fetched card text should properly decode characters like apostrophes (') and display them correctly.

Actual Behavior: The fetched card text displays characters like apostrophes (') in a different encoding, leading to incorrect display.

Additional Information:

Example with Kayla's Command : Kayla's Command,Rare,['W'],Sorcery,,"Choose two — • Create a 2/2 colorless Construct artifact creature token. • Put a +1/+1 counter on a creature you control. It gains double strike until end of turn. • Search your library for a basic Plains card, reveal it, put it into your hand, then shuffle. • You gain 2 life and scry 2.",,,BRO,The Brothers' War,"[{""date"": ""2022-10-14"", ""text"": ""None of the modes have any targets. Notably, this means that you don\u2019t have to choose a creature for the second mode until the spell resolves.""}]",Legal

You can show the problem at this line : Notably, this means that you don\u2019t have to choose a creature for the second mode until the spell resolves.

"don't" appear as "don\u2019t" and it is similar for so many special characters ( \u201c, \u201d, \u2014, etc...)

Thank you for the help.

Environment: