Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

What happenend to the Umlaut ? [SOlVED]

by karlgoethebier (Abbot)
on Dec 04, 2015 at 14:37 UTC ( [id://1149390]=perlquestion: print w/replies, xml ) Need Help??

karlgoethebier has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

i build some PDFs using LaTeX and Text::Template.

Populating my hash to fill in the template i stumbled over this:

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", }

What happenend to the Umlaut?

Update:I gave it up bothering myself. After using the tabular environment instead of hyperref forms everything works. Thanks to all that helped.

Thank you very much for any hint and best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re: What happenend to the Umlaut ?
by Anonymous Monk on Dec 04, 2015 at 15:23 UTC
    Not sure what you're asking... It seems to me you're using Encode::encode_utf8 and Data::Dump::dd? If so, two things happened:
    1. "Karl Dämlich" was encoded in utf-8:
      $customer = encode_utf8($customer);
    2. The encoded form of "Karl Dämlich" was displayed by Data::Dump::dd as "Karl D\xC3\xA4mlich". The cursory scan of the Data::Dump's source suggests that it was done by the quote function:
      sub quote { ... s/([\0-\037\177-\377])/sprintf('\\x%02X',ord($1))/eg; ... }
      presumably to make its representation unambiguous.
Re: What happenend to the Umlaut ?
by karlgoethebier (Abbot) on Dec 04, 2015 at 17:21 UTC

    Ah, i jumped to the wrong conclusion: say $data->{customer_name}; works.

    In my template i have:

     \TextField[name=Kundenname,width=\textfieldwidth,backgroundcolor=white, bordercolor={white}, value={[@-- $customer_name --@]}, readonly={true}]{\AdjustSize[l]{Kundenname:}}

    And $customer_name expands to this weird noise:

    Dprotect unhbox voidb@x group U@D 1ex{setbox z@ hbox {char 127}dimen@ -.45exadvance dimen@ ht z@ ontdimen 5 ont dimen@ }accent 127 ontdimen 5 ont U@D aegroup mlich

    I say \usepackage[utf8]{inputenc} and Umlauts get displayed correct except in something like [@-- $customer_name --@].

    Update: I have no idea how to continue. Any further hints?

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1149390]
Front-paged by GotToBTru
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found