`json:table` with integer cell values raises `TypeError: markdown must be UTF-8 encoded` since v18.10
### Summary Since v18.10, a `json:table` block with `"markdown": true` raises a `TypeError: markdown must be UTF-8 encoded` when any cell value is an integer. This worked correctly in v18.9 and earlier. ### Steps to reproduce Add the following to any merge request description or issue body: ```` ```json:table { "fields": [ { "key": "field1", "sortable": true }, { "key": "field2", "sortable": true }, { "key": "field3", "sortable": true } ], "items": [ { "field1": "value1", "field2": "[mylink](https://gitlab.com)", "field3": 2 } ], "filter": true, "markdown": true } ``` ```` ### Expected behaviour The table renders correctly, with `field3` displaying `2`. ### Actual behaviour A `TypeError: markdown must be UTF-8 encoded` is raised server-side. The table fails to render. ### Error details ``` exception.class: TypeError exception.message: markdown must be UTF-8 encoded meta.caller_id: PUT /api/:version/projects/:id/merge_requests/:merge_request_iid meta.feature_category: code_review_workflow ``` Relevant backtrace entries: ``` gitlab-glfm-markdown lib/gitlab-glfm-markdown.rb:36:in `to_html' lib/banzai/filter/markdown_engines/glfm_markdown.rb:76:in `render' lib/banzai/filter/json_table_filter.rb:89:in `block (2 levels) in render_tbody' ``` ### Versions affected - **Introduced:** v18.10 (commit [`0871050f`](https://gitlab.com/gitlab-org/gitlab/-/commit/0871050f70052d3ed4a61050c5dc122ffada1580)) - **Working:** v18.9 and earlier ### Workaround Ensure all item values in `json:table` blocks are explicitly strings in the JSON, e.g. use `"field3": "2"` instead of `"field3": 2`.
issue