Hi,
Im reading a txt file inside a PythonCaller with some special charaters in.
on the close method when i print line i can see all charaters are fine in log file.
When i pyoutput(feature) encoding gets lost. see my bit of code below
Wondering if some one have an elegant solution to pyoutput attributes in correct encoding (utf-8) without make use o python 3 interpreter or needing to import external librarys.
Thanks all
import fmeobjects
import sys, os, csv, codecs
class FeatureCreator(object):
def __init__(self):
self.delimiter = '|'
def input(self, feature):
self.fileout = 'file.txt'
def close(self):
feature = fmeobjects.FMEFeature()
reader= codecs.open(self.fileout)
for line in reader:
print line
feature.setAttribute('output', line)
self.pyoutput(feature)