develooper Front page | perl.perl5.porters | Postings from February 2012

Re: Unicode cheatsheet for Perl

Thread Previous | Thread Next
From:
Alberto Simões
Date:
February 20, 2012 10:50
Subject:
Re: Unicode cheatsheet for Perl
Message ID:
4F4295CE.1070705@alfarrabio.di.uminho.pt


On 20/02/12 18:47, Tom Christiansen wrote:
> Alberto Simões<albie@alfarrabio.di.uminho.pt>  wrote
>     on Mon, 20 Feb 2012 18:06:01 GMT:
>
>> Am I missed anything?
>
>> search by Unicode gave no results :S

Sorry.
I meant that in http://hyperpolyglot.org/scripting I didn't find any 
mention to unicode (tried to search for it without a result).

>
> I don't understand what you mean.
>
> The normal reason that Unicode searches fail is that one or both
> of the source code or the input should have been specified as being
> encoded in UTF-8 but weren't.
>
> For example, replace the ellipsis with your search:
>
>      use utf8;
>      upe v5.14;
>      use strict;
>      use warnings;
>      use open qw(:std :utf8);
>      use warnings "FATAL" =>  "utf8";
>      use charnames qw(:full :short latin greek);
>
>      use Unicode::Normalize;
>
>      while (<>) {
>          $_ = NFD($_);
>          ...
>      } continue {
>          print NFC($_);
>      }
>
>
> And if you're running blead, you may add :loose to charnames.
>
> --tom

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