JSON inside single quoted attributes just to be safe and with these flags:
php
$json = json_encode( $data, JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS );
html
<div data-json='<?= $json; ?>'></div>