my $customer = q(Karl Dämlich); $customer = encode_utf8($customer); say $customer; my $data = { customer_name => $customer, factoring_nr => '123456', user => 'karl', invoice_amount => '50.403,50', number_invoices => '5', dispatched => $date, approved => $date_time, invoices => \@invoices, }; dd $data; __END__ karl@host:~/mk_pdf # ./template.pl Karl Dämlich { approved => "04.12.2015 15:24:42", customer_name => "Karl D\xC3\xA4mlich", dispatched => "04.12.2015", factoring_nr => 123456, invoice_amount => "50.403,50", invoices => [], number_invoices => 5, user => "karl", }