I have a Prolog project containing several pl files, which are partly generated. During runtime, I use qcompile/1 to create qlf files if needed for some of the files and after that load the complete set of files using load_files/1. I know that qcompile already loads the file, but for simplicity I load the compiled qlf files again. This is no problem until I use non-ASCII characters in the file paths.
Here is a minimal example to reproduce the issue:
:- encoding(utf8). mymain :- qcompile('test.pl'), qcompile('täst.pl'), load_files(['test', 'täst']), write('OK\n').
:- encoding(utf8). constant_ascii('ABC').
:- encoding(utf8). constant_unicode('ABC').
I run the programm using the Windows build (tested with 7.6.4, 8.2.1 and the nightly build 2020-07-30):
swipl.exe -l start.pl -g mymain
As output I get:
Warning: Redefined static procedure constant_unicode/1 Warning: Previously defined at e:/projekte/prolog/test/täst.pl:2 OK
So täst.pl is loaded obviously twice, but test.pl only once. For me it seems to be that load_files only recognizes already loaded files, if the file path contains only ASCII characters.
Is this a bug in load_files?