<?php header("Content-Disposition: attachment; filename=SU\xd0\xa1\xd0\xa1\xd0\x95SS.txt"); header("Content-Type: text/plain; charset=koi8-r"); // Content-Type charset does not affect header charset. ?> Test file content.