Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> I suspect suspect trying to do this in the parser will be quite messy.
> This needs to happen before the input is converted to the server
> encoding, I think.
Indeed --- what if the server isn't using utf8 internally?
And a larger point is that the server has no idea where the file
boundaries are. If we were to do this server-side, we'd essentially
end up discarding BOM anywhere, which is more libertine than I care
to be.
regards, tom lane