Skip to content

Where do we enforce UTF-8 JSON? #67

@wking

Description

@wking

Spun off from #66, where “All configuration JSON MUST be encoded in UTF-8” is checked. And it seems to be:

$ ./ocitools generate
$ iconv -f UTF-8 -t UTF-16 config.json -o config-16.json
$ mv config-16.json config.json
$ file config.json
config.json: Little-endian UTF-16 Unicode text
$ ./ocitools validate --path .
FATA[0000] invalid character 'ÿ' looking for beginning of value

But I can't find Go docs on what input encodings are supported or UTF references in ocitools:

$ git grep -i utf origin/master
Binary file origin/master:rootfs.tar.gz matches

The Go docs reference RFC 4627, and the RFC explains how to detect the encoding, but maybe Go doesn't support that yet? Can someone with more Go+JSON experience explain how this works?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions