RE: Question about converting utf8 to ascii and char refs

[email protected] (Mike Guy)
Newsgroups perl.unicode
Message-ID <[email protected]>
"Siladi, Aaron" <[email protected]> wrote
> Ok so that should work given the string has utf8 flag set.

What's the utf8 flag got to do with it?

Nick's program works for me without the utf8 flag set:

perl -w
use Encode;
my $s = "\x99 4";
use Devel::Peek;
Dump $s;
my $n = encode('ascii',$s,Encode::FB_HTMLCREF);
print "$n\n";
__END__
SV = PV(0x117c08) at 0x122968
  REFCNT = 1
  FLAGS = (PADBUSY,PADMY,POK,pPOK)	<==== look no UTF8
  PV = 0x117480 "\231 4"\0
  CUR = 3
  LEN = 4
&#153; 4


Mike Guy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.