Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19760

json escaped unicode parse error

    XMLWordPrintable

Details

    Description

      certain escaped unicode in json failes to parse, for example a smiley emoji:

      SET @str = "{\"value\":\"\\ud83d\\ude0a\"}";
      SET @path = "$.value";
      select @str, @path, JSON_value(@str, @path);
      +--------------------------+---------+-------------------------+
      | @str                     | @path   | JSON_value(@str, @path) |
      +--------------------------+---------+-------------------------+
      | {"value":"\ud83d\ude0a"} | $.value | NULL                    |
      +--------------------------+---------+-------------------------+
      

      however this seems to work

      SET @str = "{\"value\":\"\\u00e4\\u00f6\"}";
      SET @path = "$.value";
      select @str, @path, JSON_value(@str, @path);
      +--------------------------+---------+-------------------------+
      | @str                     | @path   | JSON_value(@str, @path) |
      +--------------------------+---------+-------------------------+
      | {"value":"\u00e4\u00f6"} | $.value | äö                      |
      +--------------------------+---------+-------------------------+
      

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              dicode Tim Westervoorde
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.