in reply to Re: Perl detect utf8, iso-8859-1 encoding
in thread Perl detect utf8, iso-8859-1 encoding
use utf8; use Text::Unaccent; use Encode::Detect::Detector; ## my $author = "Sch%F6ttl"; my $author = "Sch%F6%F6ttl"; $author =~ s/%([a-zA-Z0-9][a-zA-Z0-9])/pack('C',hex($1))/eg; my $encoding = Encode::Detect::Detector::detect($author); print "encoding: $encoding: $author <br>\n"; if($encoding){ $author = unac_string($encoding, $author); print "after unac: $author<br>\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl detect utf8, iso-8859-1 encoding
by jeffenstein (Hermit) on Jul 24, 2020 at 14:32 UTC | |
by swiftlet (Acolyte) on Jul 24, 2020 at 15:07 UTC | |
by jeffenstein (Hermit) on Jul 24, 2020 at 20:06 UTC | |
|
Re^3: Perl detect utf8, iso-8859-1 encoding
by Anonymous Monk on Jul 24, 2020 at 16:32 UTC |