Hrmmm...

There is a classic joke:
What do you call someone who speaks many languages?
A polygot.
What do you call someone who speaks two languages?
A bilingual.
What do you call someone who speaks one language?
An American.

My first attempt to fix this was to add:

<code>
open FH, $ARGV[0] or die "Could not open $ARGV[0]:$!";

my $file;
#grab the whole file
{ local ($/) = undef; $file = <FH>; }

close FH;

#replace anything not in lower ASCII, Damn Americans
for (my $i = 0; $i < length($file); $i++) {
        my $char = ord(substr($file, $i, 1));

        if ($char > 128) {
                print "replacing ", chr($char), " with &#$char;\n";
                substr($file, $i, 1) = "&#$char;";
        }
}

open FH, ">$ARGV[0].tmp.$$" or die "Could not open $ARGV[0]:$!";

print FH $file;

close FH;
</code>

and change

$parser->parsefile($ARGV[0]);

to

$parser->parsefile("$ARGV[0].tmp.$$")

This correctly sets the xml file, but $article->child('RUB')->value
returns "Dragkamp om förlusttÃ¥g" instead of "Dragkamp om förlusttåg".
Does anyone know what I am doing wrong?

On 20 Jun 2001 14:15:39 +0200, Morgan wrote:
> Thank you very much for this script.
> 
> And if English had been my native lauage it had been perfect.
> 
> I need the script to add my native letters as well, I'm Swedish and
> therfor use "åäöÅÄÖ"
> in the articles. Is this possible?
> 
<snip size="massive" /> 
--
Today is Sweetmorn, the 25th day of Confusion in the YOLD 3167
Hail Eris, Hack Linux!


Reply via email to