view MoinMoin/filter/ @ 999:97ce857bdebf

whitespace-only cleanup and minor style changes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 22 Jul 2006 12:39:18 +0200
parents 930c9f03aa13
children ebcebba1afb3
line wrap: on
line source

# -*- coding: iso-8859-1 -*-
    MoinMoin - text/* file Filter

    We try to support more than ASCII here.

    @copyright: 2006 by ThomasWaldmann MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.

import codecs

def execute(indexobj, filename):
    for enc in ('utf-8', 'iso-8859-15', ):
            f =, "r", enc)
            data =
            return data
        except UnicodeError, err:
    f = file(filename, "r")
    data =
    data = data.decode('ascii', 'replace')
    return data