MSVC's implementation of std::filesystem::is_symlink throws if
given a perfectly valid path, saying
"symlink_status: The parameter is incorrect."
This appears to be a bug in the implementation, though I can't
reproduce it.
In Windows, std::filesystem::equivalent throws
std::system_error if a path contains characters that can't be
represented in the system code page (e.g. Windows 1252). This is
undocumented and seems unnecessary as Microsoft's own docs say Windows
paths are stored natively in Unicode, so it sounds like a bug to me.
To work around this, return true early if the path objects are equal,
so std::filesystem::equivalent doesn't need to be called, and catch
system_error if it does need to be called - this may result in false
negatives, but for LOOT's purposes that is fine and is very unlikely
anyway.
To fix checking self-consistency when loadorder.txt is not valid
UTF-8. This also adds support for hoisted plugins, but LOOT's
sorting algorithm doesn't yet support them, so it is unused.