Am 05.11.26 um 9:32 AM schrieb FX Coudert:
Hi,
The current behavior of gfortran (scanner.cc:load_file) was implemented
by FX in 2007/2008. His PR mentions
https://en.wikipedia.org/wiki/Byte_order_mark
The presence of a BOM as first character of a file is different from the use of
U+FEFF ZERO WIDTH NO-BREAK SPACE as a character in the rest of the file.
Since it’s been handled in a particular way for 20 years with no complaints,
and in line with other compilers, I don’t see why it would be important to
change the current behavior (other than fix the memory issue).
FX
Thanks, FX.
Before pushing, because the existing testcases for BOM are free form,
I decided to rename the new testcase (fixed form!) to bom_UTF-8-2.f .
Pushed as r17-5986-gbf136cb5649057 to mainline.
Harald