<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Calibri, Arial, Verdana, sans-serif; font-size: 12pt;"><div>Tomas-<br></div><div><br></div><div>Thanks for pursuing this! Generally a good approach.<br></div><div><br></div><div>I do not like item 3 in that the function, as described, is named DetectUtfBom but does more than detect. Side effects of functions are generally not good. I would at least rename it something like DetectAndHandleUtfBom.<br></div><div><br></div><div>But to fully correct the situation, I would also change it to a procedure since leaving it as a function still suggests it only returns a result and has no other side effects.<br></div><div><br></div><div>Doug C.<br></div><br><div style="" class="zmail_extra"><br><div id="Zm-_Id_-Sgn1">---- On Sun, 15 Sep 2019 18:20:22 -0400 <b>Tomas Hajny <XHajT03@hajny.biz></b> wrote ----<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div>3) New function 'DetectUtfBom (var T: text): boolean' will be added. <br>This function may be called after the call to 'Reset (T: text)' to check <br>for existence of BOM at the beginning of the text file. If it is found <br>(Result=true), SetTextCodePage is invoked automatically from <br>DetectUtfBom with the codepage value corresponding to the found BOM and <br>encoding variant. If BOM is not found (Result=false), nothing changes.<br></div></blockquote></div><div><br></div></div><br></body></html>