<div dir="ltr"><div><div>What could maybe be something, would be to add another -: option to Gambit, that instructs Gambit to use a non-default(non-127) readtable-max-unescaped-char-set setting.</div><div><br></div><div>Like, -:eN  (e as in "escape" and "N" as in "nothing", meaning #\U0010ffff).</div><div><br></div><div>This would make the escaping behavior you seem to be hinting at, more easily accessible (i.e. more easy to get going than to need to include the whole script you printed out before in an -e ... - argument).</div></div><div><br></div><div><br></div><div><br></div><br><div class="gmail_extra"><br><div class="gmail_quote">2015-05-30 12:13 GMT+05:30 Atticus <span dir="ltr"><<a href="mailto:atticus0@posteo.org" target="_blank">atticus0@posteo.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">> Should the external representation of strings depend on the character encoding of the output port?  In other words, if the character encoding of the byte output port is<br>
><br>
> - ASCII then characters whose code are >= 128 would use escapes like \374<br>
> - ISO-8859-1 then characters whose code are >= 256 would use escapes<br>
> - UCS-2 then characters whose code are >= 65536 would use escapes<br>
> - in all other cases escapes would not be used because all Unicode characters can be encoded<br>
<br>
</span>Imho yes. But to be clear, let's say the external representation of<br>
scheme strings depends now on the character encoding of the output port<br>
and I have the above explained situation, I have an utf-8 port and need<br>
to print to ASCII only, then I can still do that by changing the output<br></blockquote><div><br></div><div>Atticus, you're forgetting that the "external representation" discussed here regards only the escaping applied in the serialization of objects.</div><div><br></div><div><br></div><div>This is a really sensitive thing where exactitude and correctness in any real use must have priority over extra nice features.</div><div><br></div><div>The character encoding of the output and input port here is the same, and setting Gambit in -:f8 to be able to read UTF-8 encoded sourcecode files, and -:t8 to be able to input unicode chars directly in the REPL, is generally a good thing -</div><div><br></div><div>And there's no reason that that would somehow be related to that escaping behavior would change.</div><div><br></div><div><br></div><div>Again, the direct output is always done unescaped:</div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div>gsi -:t8</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div>(print "\374\n")</div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>If you want unescaped object output occasionally only, you could implement your own write/pp routine with readtable-max-unescaped-char-set set as you want.</div><div><br></div></div></div></div>