'Returns the contents of a specified file.
This keyword reads the specified file and returns the contents.
Line breaks in content are converted to platform independent form.
See also `Get Binary File`.
``encoding`` defines the encoding of the file. The default value is
``UTF-8``, which means that UTF-8 and ASCII encoded files are read
correctly. In addition to the encodings supported by the underlying
Python implementation, the following special encoding values can be
used:
- ``SYSTEM``: Use the default system encoding.
- ``CONSOLE``: Use the console encoding. Outside Windows this is same
as the system encoding.
``encoding_errors`` argument controls what to do if decoding some bytes
fails. All values accepted by ``decode`` method in Python are valid, but
in practice the following values are most useful:
- ``strict``: Fail if characters cannot be decoded (default).
- ``ignore``: Ignore characters that cannot be decoded.
- ``replace``: Replace characters that cannot be decoded with
a replacement character.
``encoding_errors`` argument was added in Robot Framework 2.8.5 and the
support for ``SYSTEM`` and ``CONSOLE`` encodings in Robot Framework 3.0.'

def get_file(self, path, encoding='UTF-8', encoding_errors='strict'):

    path = self._absnorm(path)
    self._link("Getting    file    '%s'.", path)
    encoding = self._map_encoding(encoding)
    if IRONPYTHON:
        with open(path) as f:
            content = f.read().decode(encoding, encoding_errors)
    else:
        with io.open(path, encoding=encoding, errors=encoding_errors, newline='') as f:
            content = f.read()
    return content.replace('\r\n', '\n')
