I think Luke's suggestion will work if you use f.read() (to read the whole file as a single string) instead of f.readlines() and f.write() instead of writelines().
Kent luke wrote: > List: > I'm forwarding this private message(hope you don't mind Denise) > I personally have no idea what to do, but > someone else might be able to help. > -Luke > > > ----- Forwarded Message ----- > > text is a list, so you can't encode it. but you can iterate over each > of the elements and encode them. I have tried several variations of > that, but keep ending up with all my newlines being little boxes. any > ideas? > > Thanks, > Denise > > On 8/15/05, luke <[EMAIL PROTECTED]> wrote: >>I dont know much about Unicode but it seems like >>f = file(filename, "r") >>text = f.readlines() >>text = text.encode() >>#or maybe just text.encode()? >>f.close() >> >>should encode the filetext to unicode. >>then you could do a >>f = file(filename, "w") >>f.writelines(text) >>f.close() _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor