Sombrerero_loco has asked for the wisdom of the Perl Monks concerning the following question:
But, when i read the xml has a plain text (using a While <FILEHANDLE>), i sent the data to the subrroutine to format it, using that condition:sub translator { + $vNombre = $_[0]; $vNombre = lc $vNombre; $vNombre =~ tr/áàèéìíòóùú/aaeeiioouu/; $vNombre =~ tr/ÀÁÈÉÌÍÒÓÙÚ/AAEEIIOOUU/; $vNombre =~ tr/"'/||/d; return $vNombre; }
But when i print the data, it seems it takes the accent, quotes and so on, not as a ó or á letter, or a "" or '', its use weird characters.if ($vl_read =~ /<hwAssetUserField3 type="attrib">(.+?)<\/hwAssetUserF +ield3>/){ $vNombre = $1; $vNombre = &translator($vNombre);
or at last, it should detect " in the tr and change it to another character of (see the /d option), eliminate, but no. Also, if it reads a accent vowel, it reads, for example:'galicia vii' it should be "galicia vii"
Im using a spanish computer, but it seems perl its reading in a wrong way from the xml file but not from a txt file. Any idea???? Thanks!centro de apoyo informático when it should read centro de apoyo + informatico.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with quotes, speciao characters and so on, reading a xml file
by almut (Canon) on Dec 29, 2009 at 11:01 UTC | |
|
Re: Problems with XML encoding
by FalseVinylShrub (Chaplain) on Dec 29, 2009 at 11:03 UTC | |
by Sombrerero_loco (Beadle) on Dec 29, 2009 at 11:49 UTC | |
by FalseVinylShrub (Chaplain) on Dec 29, 2009 at 12:14 UTC | |
by Jenda (Abbot) on Dec 30, 2009 at 11:14 UTC |