Hex dump: Difference between revisions
m
→{{header|Phix}}: marked js-incompatible, added one page at a time note
m (→{{header|Phix}}: see talk) |
m (→{{header|Phix}}: marked js-incompatible, added one page at a time note) |
||
Line 239:
=={{header|Phix}}==
<small>Aside: Phix does not really "do" utf-16, that is in source code terms, but declaring things as utf-8 and converting to utf-16 is not exactly hard. See talk page.</small>
<!--<syntaxhighlight lang="phix">(
<span style="color: #008080;">
<span style="color: #004080;">string</span> <span style="color: #000000;">utf8</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"\#EF\#BB\#BFRosetta Code is a programming chrestomathy site \xF0\x9F\x98\x80."</span>
<span style="color: #004080;">sequence</span> <span style="color: #000000;">utf16</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">utf8_to_utf16</span><span style="color: #0000FF;">(</span><span style="color: #000000;">utf8</span><span style="color: #0000FF;">)</span>
Line 274:
<span style="color: #000000;">hexdump</span><span style="color: #0000FF;">(</span><span style="color: #000000;">s</span><span style="color: #0000FF;">,</span><span style="color: #000000;">bHex</span><span style="color: #0000FF;">:=</span><span style="color: #004600;">false</span><span style="color: #0000FF;">)</span>
<!--</syntaxhighlight>-->
Although not shown, the intention is the outer calling code (last four lines) could call hexdump() to display one page at a time, with appropriate user input, and/or read s in chunks and pass a file offset instead of or as well as start, finish.
{{out}}
<pre>
|