Jan Eden <[EMAIL PROTECTED]> wrote: : : I have the following script (just a test): : : --- : #!/usr/bin/perl -w : : use strict; : use HTML::Entities; : : my $string = 'Alfred Döblin: Berlin Alexanderplatz'; : my $string2 = 'Alfred Döblin: Berlin Alexanderplatz'; : : $string = decode_entities($string); : : print $string, "\n", $string2, "\n"; : --- : : This prints : : Alfred D?blin: Berlin Alexanderplatz : Alfred Döblin: Berlin Alexanderplatz : : in my terminal : : Now the perldoc for HTML::Entities says : : > decode_entities( $string ) : > This routine replaces HTML entities found in the : > $string with the corresponding ISO-8859-1 character, : > and if possible (under perl 5.8 or later) will : > replace to Unicode characters. Unrecognized : > entities are left alone. : : I do have Perl 5.8.1, so I'd expect the decode_entities : method to return a Unicode character string. Why doesn't : it do that?
It works for the tests I made from an UltraEdit32 window under Windows XP and on Windows XP DOS window. Though the ö showed up as a division sign in both strings. It also works fine on Apache on XP from a cgi script. It may be an issue with your terminal software. Is your terminal the place you expect to display results of a script like this? Have you tried it under a different terminal emulation? I tried a comparison test. I used this and always received two equal strings. print "Same\n" if $string eq $string2; When I got to the end of this reply I realized that I was using ActiveState 5.8.3. perl582delta and perldelta don't specify a change in core for unicode. You might try looking at the ordinal values of both strings. print ord $_ foreach split //, $string; print "\n"; print ord $_ foreach split //, $string2; If they are the same, capture the terminal output and see if something has changed in the ordinal values after they were sent to the terminal. HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>