On 9/11/06, <b class="gmail_sendername">Marcin 'Qrczak' Kowalczyk</b> &lt;<a href="mailto:qrczak@knm.org.pl">qrczak@knm.org.pl</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&quot;Paul Prescod&quot; &lt;<a href="mailto:paul@prescod.net">paul@prescod.net</a>&gt; writes:<br><br>&gt; Guido's goal was that quick and dirty text processing should &quot;just<br>&gt; work&quot; for newbies and encoding-disintererested expert programmers.
<br><br>What does 'guess' mean for creating files?</blockquote><div><br>I wasn't sure about this one. But on Windows and Mac it seems safe to generate UTF-8-with-BOM. Textedit, VIM and notepad all auto-detect the UTF-8 BOM and do the right thing.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2. Files are created in UTF-8.<br><br>&nbsp;&nbsp; Then files encoded with the locale encoding will be silently
<br>&nbsp;&nbsp; recoded to UTF-8, causing trouble for further work with the file<br>&nbsp;&nbsp; (it can't be even typed to the terminal).</blockquote><div><br>It can on the teriminal on the mac. And on the increasing number of UTF-8 defaulted Linux distributions. Perhaps it should by default use the Unix locale for output, but only on Unix and not on mac/Windows.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I've implemented a hack which allows simple programs to &quot;just work&quot; in
<br>case of UTF-8. It's a modified encoder/decoder which escapes malformed<br>UTF-8 sequences with '\0' bytes, and thus allows arbitrary byte<br>sequences to round-trip UTF-8 decoding and encoding. It's not used by<br>default and it's never used when &quot;UTF-8&quot; is specified explicitly,
<br>because it's not the true UTF-8, but I have an environment variable<br>which says &quot;if the locale is UTF-8, use the modified UTF-8 as the<br>default encoding&quot;.</blockquote><div><br>That's an interesting idea. I'm not sure if you are proposing it as being applicable to this PEP or not...
<br><br>&nbsp;Paul Prescod<br><br></div><br></div>