Data::Dumper is dumping the internal format.  To ensure compatibility, it
is using the \x{df} escape to represent LATIN SMALL LETTER SHARP S. To see
it rendered as a character, just print it:

#!/usr/bin/perl

use strict;
use feature 'say';

use XML::Simple;

#warnings should come last to handle any registered warnings in previous
modules
use warnings;

binmode STDOUT, ":encoding(UTF-8)";

my $xml = XML::Simple->new;
my $data = $xml->XMLin("test.xml");

say $data->{Regaletikett_ausgeben};


On Thu, Jul 28, 2016 at 9:05 AM hw <h...@gc-24.de> wrote:

>
> Hi,
>
> I would like to read XML files which look like this:
>
>
> <?xml version='1.0' ?>
> <data id="build_Inventur_1469705446">
>    <meta
>        http-equiv="content-type" content="text/html; charset=UTF-8">
>      <instanceID>uuid:ee1bd852-37ee-4965-a097-50130cf6dac7</instanceID>
>    </meta>
>    <Stationsnummer>Infostand</Stationsnummer>
>    <Mitarbeiter_inv>5449000134264</Mitarbeiter_inv>
>    <Bezeichnung1/>
>    <Regaletikett_ausgeben>gro&#223;</Regaletikett_ausgeben>
>    <Erfassung>
>      <Artikel_erfassen/>
>      <Lagerstaette>5449000134264</Lagerstaette>
>      <Artikelstapel>
>        <EAN_Artikel>5449000134264</EAN_Artikel>
>        <Preis>10.0</Preis>
>        <Menge>20</Menge>
>        <Etikettentyp/>
>      </Artikelstapel>
>    </Erfassung>
> </data>
>
>
> There is an Umlaut, ß, supposed to be at
>
>
> <Regaletikett_ausgeben>gro&#223;</Regaletikett_ausgeben>
>
>
>
> which is apparently impossible to read.  The following program ...
>
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use feature 'say';
>
> use XML::Simple;
> use Data::Dumper;
>
>
> my $xml = new XML::Simple;
> my $data = $xml->XMLin("test.xml");
>
> open my $fh, ">", 'pout';
> print $fh Dumper($data);
> close $fh;
>
> print Dumper($data);
>
>
> exit 0;
>
>
> ... gives me this output:
>
>
> $VAR1 = {
>            'Bezeichnung1' => {},
>            'id' => 'build_Inventur_1469705446',
>            'Stationsnummer' => 'Infostand',
>            'meta' => {
>                      'content' => 'text/html; charset=UTF-8',
>                      'http-equiv' => 'content-type',
>                      'instanceID' =>
> 'uuid:ee1bd852-37ee-4965-a097-50130cf6dac7'
>                    },
>            'Mitarbeiter_inv' => '5449000134264',
>            'Regaletikett_ausgeben' => "gro\x{df}",
>            'Erfassung' => {
>                           'Artikelstapel' => {
>                                              'Menge' => '20',
>                                              'Preis' => '10.0',
>                                              'EAN_Artikel' =>
> '5449000134264',
>                                              'Etikettentyp' => {}
>                                            },
>                           'Artikel_erfassen' => {},
>                           'Lagerstaette' => '5449000134264'
>                         }
>          };
>
>
> I´m not getting any better results when adding an encoding tag to the
> XML file and when writing the Dumper output to a file.
>
> Is it impossible to use Umlaute in XML Files?
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to