develooper Front page | perl.perl5.porters | Postings from August 2013

Re: [perl #119239] started out as doc clarification needed in 'eval...but...

Thread Previous | Thread Next
From:
Eric Brine
Date:
August 16, 2013 06:23
Subject:
Re: [perl #119239] started out as doc clarification needed in 'eval...but...
Message ID:
CALJW-qGXwq2Sg4MJisqXpBSrUQXJd_x2b4waFEj0k3-=vEBd9w@mail.gmail.com
On Thu, Aug 15, 2013 at 9:38 PM, Linda Walsh via RT <
perlbug-followup@perl.org> wrote:

> On Thu Aug 15 13:32:51 2013, ikegami@adaelis.com wrote:
> > On Thu, Aug 15, 2013 at 3:43 PM, Linda Walsh via RT <
> > perlbug-followup@perl.org> wrote:
> >
> > > Points) A) - "(to myself as much as anyone)" - use utf8 only applies to
> > > source code not content strings, so my wonderings why the Japanese
> > > INU(dog) YA(night) SHA(dividing point) came out "ok"
> >
> >
> > $ perl -Mutf8 -E'say "\x{72AC}\x{591C}\x{53C9}"'
> > Wide character in say at -e line 1.
> > 犬夜叉
>
> ----
> Urg...um... so the original example that I had that
> printed "
> $string="“犬夜叉”";
>

You didn't use C<< use utf8; >> which means your code couldn't possibly
have contained

    $string="“犬夜叉”";  # "\x{201C}\x{72AC}\x{591C}\x{53C9}\x{201D}"

It actually contains

    $string="�����";  #
"\xE2\x80\x9C\xE7\x8A\xAC\xE5\xA4\x9C\xE5\x8F\x89\xE2\x80\x9D"

You might have saved the program in UTF-8, but you told Perl it was
iso-8859-1 (by not using C<< use utf8; >>).

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About