<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 25, 2008, at 5:13 PM, Robert Virding wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">2008/9/26 Dave Smith <span dir="ltr"><<a href="http://dave.smith.to">dave.smith.to</a>@<a href="http://gmail.com">gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div><br><br>You do have me thinking about what it would take to write an alternate Erlang pre-compiler that will do this type of decoding. Hmmm. A weekend research project for me. :)</div></blockquote><div><br>If you were to make these modifications in file_server/file_io_server then you wouldn't have to make any modifications io_lib, erl_scan, ... These would still work out of the bag. The only problem is detecting you are using UTF-8, UTF-16... when you open the file.<br></div></div></div></blockquote></div><br><div>The usual approach seems to be to examine the first couple bytes to look for a BOM, and otherwise assume ASCII.  (Python also allows a special comment in the first two lines, and Perl has a lexically scoped 'use utf8' pragma.)</div><div><br></div><div><br></div><div>-kevin</div></body></html>