Gunnar Hjalmarsson wrote:
Or did you possibly mean the utf8::decode() function?

I mean this:

#!/usr/bin/perl

use warnings;
use strict;
# use utf8;
use Encode;

my $utf8_encoded = "smörgåsbord";
print('is_utf8: ' . (Encode::is_utf8($utf8_encoded) ? 'TRUE' : 'FALSE') . "\n");

This outputs "FALSE" here, but uncomment "use utf8" and it gets "TRUE". Looks like with "use utf8" those string literals aren't ordinary byte strings anymore. Perhaps they are as if Encode::decode had been applied to them?

STF

=======================================================================
http://eisenbits.homelinux.net/~stf/
OpenPGP: DFD9 0146 3794 9CF6 17EA  D63F DBF5 8AA8 3B31 FE8A
=======================================================================

--
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