diff --git a/saucebrush/filters.py b/saucebrush/filters.py index a2b67b2..c292dfa 100644 --- a/saucebrush/filters.py +++ b/saucebrush/filters.py @@ -360,6 +360,8 @@ class UnicodeFilter(Filter): for key, value in record.iteritems(): if isinstance(value, str): record[key] = unicode(value, self._encoding, self._errors) + elif isinstance(value, unicode): + record[key] = value.encode(self._encoding, self._errors) return record ########################### diff --git a/saucebrush/sources.py b/saucebrush/sources.py index bebeeae..c00a3e1 100644 --- a/saucebrush/sources.py +++ b/saucebrush/sources.py @@ -22,9 +22,9 @@ class CSVSource(object): ignoring the first row (presumed to be column names). """ - def __init__(self, csvfile, fieldnames=None, skiprows=0): + def __init__(self, csvfile, fieldnames=None, skiprows=0, delimiter=','): import csv - self._dictreader = csv.DictReader(csvfile, fieldnames) + self._dictreader = csv.DictReader(csvfile, fieldnames, delimiter=delimiter) for _ in xrange(skiprows): self._dictreader.next()