https://sourceware.org/bugzilla/show_bug.cgi?id=32003

--- Comment #12 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Benjamin Drung from comment #11)
> (In reply to H.J. Lu from comment #9)
> > It should be human readable.
> 
> What do you recommend? IMO percent-escaping is readable enough and increases
> the size of the already long string not too much.
> 
> The encoding of the JSON
> {"type":"deb","os":"ubuntu","name":"dpkg","version":"1.22.6ubuntu15",
> "architecture":"amd64"} would be:
> 
> -Wl,--encoded-package-metadata=%7B%22type%22:%22deb%22%2C%22os%22:
> %22ubuntu%22%2C%22name%22:%22dpkg%22%2C%22version%22:%221.22.
> 6ubuntu15%22%2C%22architecture%22:%22amd64%22%7D
> 
> At first it might look confusing, but the relevant strings can be seen on a
> second look: "type", "deb", "os", "ubuntu", "name", "dpkg", "version",
> "1.22.6ubuntu15", "architecture", "amd64". Only the beginning of the version
> number is harder to see.
> 
> There are multiple tools that can encode/decode it. For example Python's
> urllib.parse.unquote and urllib.parse.quote.
> 
> I am open for better encodings. I am open for making --package-metadata
> percent-decode the value instead of adding a new parameter. Percents are
> relative safe encoding option. The Debian package name and the Debian
> version are not allowed to contain percents. The os, type, and architecture
> will not have percents in the

%22 isn't human readable.  Do we need to escape { and }? We need to escape "
and ,.  Should $ be supported in JSON code? Will "%[string]" escape work?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to