in reply to A module for creating "sane" URLs from "arbitrary" titles?

# First, downgrade to ASCII chars (or transliterate if possible) @_ = unidecode(@_); for( @_ ) { s/['"]//gi; s/[^a-zA-Z0-9.-]/ /gi; s/\s+/_/g; s/_-_/-/g; s/^_+//g; s/_+$//g; };

You say transliterate but you don't actually use transliterate.

s/['"]//gi;

Since when do the ' and " characters have both upper and lower case representations?

tr/'"//d;
s/[^a-zA-Z0-9.-]/ /gi;

Which characters does the /i option affect here?

tr/a-zA-Z0-9.-/ /c;

Replies are listed 'Best First'.
Re^2: A module for creating "sane" URLs from "arbitrary" titles?
by Corion (Patriarch) on Apr 20, 2012 at 21:40 UTC

    By "transliterate" I mean what Text::Unidecode does, for example for 北亰 to "Bei Jing". I assume the same will happen for Cyrillic letters.

    Good point on the /i options - they're useless indeed.