var myvar = "<?php echo $myVarValue;?>";
Expanding on someone else's answer:
<script> var myvar = <?php echo json_encode($myVarValue); ?>; </script>
Using json_encode() requires:
$myVarValueencoded as UTF-8 (or US-ASCII, of course)
Since UTF-8 supports full Unicode, it should be safe to convert on the fly.