Skip to content

failed conversion of special unicode chars from UTF-8 const char* to wxString #189

@TomTkacz

Description

@TomTkacz

In the CLI, when executing write_image_file(c,file:"card.png") where c := new_card([text:"<sym>∞</sym>"]), the incorrect symbol is put onto the card image.



Displayed are the individual ASCII bytes of the symbol [0xE2 0x88 0x9E], not its unicode representation. This is despite data/magic-mana-small.mse-symbol-font/symbol-font (used in the magic-m15-altered style) listing this as the correct symbol.



I believe I tracked the issue to src/util/io/reader.cpp, where the read_utf8_line function feeds the line containing the character into a const char* buffer. When the buffer is converted to a wxString via wxString::FromUTF8, an empty string is returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions