Function “readFileUTF8”

function readFileUTF8(path)

Reads a UTF-8 encoded file

This function reads the file contents, skipping a possible UTF BOM, and sanitizes the UTF-8 encoding if necessary.

Parameters

NameTypeDescription
pathstringPath or URL of the file to read

Return Value

Returns the contents of the file as a string