Open a file for reading with either the standard built-in open() or the
    open in the codecs module for reading UTF-16 encoded files.

    :param fn: Name of the file to open
    :param utf16: Boolean flag to specify a UTF-16 file

def open_enc(fn, utf16):
    """
    Open a file for reading with either the standard built-in open() or the
    open in the codecs module for reading UTF-16 encoded files.

    :param fn: Name of the file to open
    :param utf16: Boolean flag to specify a UTF-16 file
    """
    if utf16:
        return codecs.open(fn, encoding='utf-16')  # -be')
    return open(fn, 'rU')