Skip to content

Fix character encoding for special characters in JSON output #524

@sretenD

Description

@sretenD

The application is producing undecoded characters like šđćž due to an encoding error during JSON or HTML writing. The m2json.m file needs to be modified to ensure proper UTF-8 encoding before escaping special characters. The suggested solution is to add the unicode2native(val, 'UTF-8') function before line 43 in m2json.m.

41|          else
42|              val = unicode2native(val, 'UTF-8'); % Convert to UTF-8
43|              val = checkescape(val); % add escape characters
44|              valstr = sprintf(\"\"\"%s\"\"\", val);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions