Skip to content

bug: inconsistent spaces in character married_to #788

Closed as not planned
Closed as not planned

Description

@tobiasehlert

Description

A character's married_to value can look identical in v4 and v5 but fail a direct string equality comparison because the space has a different Unicode code point.

Steps to reproduce

  1. Fetch https://api.tibiadata.com/v4/character/Maltusia.
  2. Fetch https://api.tibiadata.com/v5/character/Maltusia.
  3. Compare character.character.married_to from the two responses.

Actual behavior

Observed on 2026-10-19:

API Value (escaped for clarity) Space
v4 Lando\u00A0Atryda Non-breaking space (U+00A0)
v5 Lando\u0020Atryda Regular space (U+0020)

The names render alike, but direct equality returns false.

Expected behavior

Return regular spaces (U+0020) consistently in married_to, regardless of API version or upstream source.

Investigation

  • Maltusia's fansite API JSON response supplies "spouse":"Lando Atryda" with a regular space.
  • The HTML source supplies Lando Atryda, which decodes to a non-breaking space.
  • The existing Trollefar fixtures show the same upstream difference: HTML contains Mighty\u00A0troll, while fansite JSON contains Mighty troll.
  • The current HTML parser already calls TibiaDataSanitizeStrings for married_to, converting non-breaking spaces to regular spaces. The fansite JSON parser copies spouse directly without this normalization.
  • The live v4 discrepancy has not been explained by the current HTML parser; deployment differences have not been verified.

Scope

Keep the fix limited to spouse names: normalize U+00A0 to U+0020 in the fansite API spouse mapping and retain HTML/JSON parity coverage in TestCharacterTrollefar. No broader normalization of other character fields is requested.

Activity

  1. changed the title [-]Inconsistent spaces in character married_to between v4 and v5[/-] [+]bug: inconsistent spaces in character married_to[/+] on Oct 19, 2026
  2. self-assigned this
    on Oct 19, 2026
  3. added theissue type on Oct 19, 2026
  4. added this to the v5.0 milestone on Oct 19, 2026
  5. tobiasehlert commented on Oct 19, 2026

    @tobiasehlert
    MemberAuthor

    Closing as an accepted v4-to-v5 behavior change, not an inconsistency within v5. Hosted checks for Maltusia and Trollefar confirmed that both v5 HTML parsing and v5 fansite parsing return plain spaces (U+0020) in character.married_to, as intended. Deployed v4 returns non-breaking spaces (U+00A0), but v4 will receive no further updates; v5 is the way forward. PR #789 has been closed without merging because no additional v5 fix is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions