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

Issue with Character Encoding in Card Text #40

Open
mossday opened this issue Aug 16, 2023 · 0 comments
Open

Issue with Character Encoding in Card Text #40

mossday opened this issue Aug 16, 2023 · 0 comments

Comments

@mossday
Copy link

mossday commented Aug 16, 2023

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:

  • I have tested different approaches to decode the characters, including using Python's html.unescape() and direct replacement of Unicode characters, but the issue persists.
  • The problem is not related to the specific language setting (French, in my case), as I have tested without specifying a language.
  • I suspect that the issue might be related to how the MTGSDK handles character encoding when fetching card data.

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:

  • Python version: [3.11.4]
  • MTGSDK version: [1.3.1]
  • Operating System: [Windows 10 Professionnal x64]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant