A UTF-8 file shouldn't include a byte order markk; however, I've run into vendor libs that include a BOM and this causes a fatal error. The problem could be patched by stripping:
--- a/src/frontend/inpcom.c
+++ b/src/frontend/inpcom.c
@@ -1392,6 +1392,13 @@
#endif
}
+ /* Strip a UTF-8 byte order mark at the start of a line -- i.e. at
+ the start of a file written by a Windows editor. A BOM is never
+ legal SPICE syntax; left in place it glues to the first token
+ (fatal ".subckt/.ends mismatch" class errors in included libs). */
+ if (!intfile && buffer && strncmp(buffer, "\xEF\xBB\xBF", 3) == 0)
+ memmove(buffer, buffer + 3, strlen(buffer + 3) + 1);
+
#ifdef TRACE
/* SDB debug statement */
printf("in inp_read, just read %s", buffer);
Minimal repro files are attached.
Thanks for your input.
Patch is uploaded to development git branch pre-master-47.
Thanks for applying the patch!