From 5e6c8aeb17de4f88bc6366c2fe045a1b82acb2bc Mon Sep 17 00:00:00 2001 From: Brian O'Donnell Date: Wed, 22 Apr 2015 10:56:11 -0400 Subject: [PATCH] Changed string parsing to handle unicode characters properly --- pod_feeder.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pod_feeder.pl b/pod_feeder.pl index 4d3f573..597179a 100755 --- a/pod_feeder.pl +++ b/pod_feeder.pl @@ -243,13 +243,13 @@ sub get_feed_items { $link_part =~ s/(\?.*)$//; # split up string - my @parts = split( /[^A-Za-z0-9]/, $link_part ); + my @parts = split( /^(\p{Letter}|\p{Number})]/, $link_part ); push( @hashtags, @parts ); } # try to guess tags from the title - if( $params{'extract_tags_from_title'} ){ + if( $params{'extract_tags_from_title'} ){ # split up string my @parts = split( /\s+/, $item->{'title'} ); @@ -321,8 +321,8 @@ sub hashtagify { my @list = @$list_ref; foreach my $item ( @list ){ - # remove non-alphanumerics and spaces - $item =~ s/[^A-Za-z0-9]//g; + # remove non-alphanumerics + $item =~ s/[^(\p{Letter}|\p{Number})]//g; # drop stop words next if length( $item ) < 3;