FsonWriter has three dialects. The default, Fson, is the comment-preserving pretty-printer from Modifying & Saving. The other two convert.

Json — strict JSON

FsonWriter w;
w.setDialect( FsonWriter::Dialect::Json );
w.write( doc, std::cout );

or fson-check --json config.fson.

RuleEffect
commentsremoved — plain JSON cannot carry them
keysall quoted
hex lexemesrewritten to decimal (0x4064)
Infinity / -Infinity / NaNthrows std::domain_error — no JSON representation. fson-check catches it and reports a write failure (exit 2)
`\`-block stringswritten as an ordinary quoted string
-- disabled membersdropped (JSON cannot hold a comment; --keep still works)
--barerejected — JSON keys are always quoted

Json5 — JSON5-compliant

w.setDialect( FsonWriter::Dialect::Json5 );

or fson-check --json5 config.fson.

RuleEffect
commentskept — a nested block comment is flattened to one // line per source line (JSON5 forbids nesting)
bare keysstay bare
number lexemesverbatim — hex stays hex, Infinity / NaN stay literal
-- disabled membersdefault: turned into a comment rendering key: value
--baresupported (JSON5 allows bare keys)

DisabledMemberPolicy

-- has no equivalent in either target, so a disabled member is handled by FsonWriter::DisabledMemberPolicy:

Policyfson-check flagBehaviour
ConvertToComment(default)JSON5: synthesize a // key: value comment (split over lines for a container). JSON: same as Drop.
Keep--keepemit as an ordinary member, no -- — may produce a duplicate key
Drop--drop-disabledemit nothing

Combination rules

--json and --json5 are mutually exclusive, and neither can be combined with -i (an in-place conversion would silently lose structure — write to --output or stdout). --keep and --drop-disabled are mutually exclusive and each requires --json or --json5.

fson-check --json --keep config.fson | jq '.database'
fson-check --json5 --bare config.fson --output config.json5

Full flag reference: Tools › fson-check.