diff --git a/source/vibe/core/file.d b/source/vibe/core/file.d index 410ddf3..db2a1ea 100644 --- a/source/vibe/core/file.d +++ b/source/vibe/core/file.d @@ -118,7 +118,9 @@ string readFileUTF8(NativePath path) { import vibe.internal.string; - return stripUTF8Bom(sanitizeUTF8(readFile(path))); + auto data = readFile(path); + auto idata = () @trusted { return data.assumeUnique; } (); + return stripUTF8Bom(sanitizeUTF8(idata)); } /// ditto string readFileUTF8(string path)