Output UTF-8; handle empty lines