removed encoding parameter from write function, fixes problems on php 4.2