reading a greek character from a file

985 Views Asked by At

I am trying to read a line from the file ( in utf-16-le) that has a greek alphabet. here is the code:

f = codecs.open("dump.tmp", "r",'utf-16-le')
fr = f.readlines()
for line in fr:
    if line.startswith("MY LINE                     {u'\u03BD'<GEN>}"):
    gr = line.split("}")
    print gr

I do not get errors but nothing prints. So If I use the shell to print just say:

print u"\u03BD"

I am able to print this greek character. Am I doing something incorrect while reading the line?

I mean I tried sometime writing the character to the file and it worked. However, while reading the same trick does not seem to work.

0

There are 0 best solutions below