Commit graph

4 commits

Author SHA1 Message Date
Sophie Hirn
40115256b6 json: Allow encoding multibyte UTF-8 sequences
The current implementation rejects all input with bytes > 0x7E, which includes
all multibyte UTF-8 sequences.  According to ECMA-404, Section 9, only double
quotation marks, backslashes, and characters 0x00 - 0x1F must be escaped
in JSON strings, so non-ascii bytes can just be passed without escaping.
This also mirrors what the decoder does above.

Of course this allows invalid UTF-8 characters to be encoded.  Checks for this
could be added as well, but at least the decoder does not seem to do that.
And from what I can tell from a quick glance, the text output path does not
check that either.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1310
2025-12-18 20:35:27 +00:00
Arun Raghavan
874a609959 json: Allow non-ASCII UTF-8 strings
Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1398
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/813>
2024-07-02 14:15:43 +00:00
acheronfail
19adddee31 pactl: add format flag for JSON output
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/497>
2021-08-11 15:31:05 +00:00
Igor V. Kovalenko
2a5497bac5 json: remove json from public API
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/570>
2021-06-03 21:15:48 +00:00
Renamed from src/pulse/json.c (Browse further)