in reply to Re: Strip utf-8 dangerous url chars
in thread Strip utf-8 dangerous url chars

I tried to use [\W] and also [\p{L}]
They works well for all languages, but when I'm trying to use it in web enviroment they don't work.
With  [\p{L}] i get �����(black triangles with question mark) and the [\W] doesn't work at all. I mean it just removes all the letters is not english.

Replies are listed 'Best First'.
Re^3: Strip utf-8 dangerous url chars
by ikegami (Patriarch) on Apr 04, 2011 at 15:52 UTC

    First, I forgot the "^" in my pattern.

    Secondly, Perl doesn't know or care whether it was launched by a web server. Blaming this for the change in behaviour is misdirected. Obviously, the strings you are trying to process are not the same. Start by finding the difference in the strings using

    { use Data::Dumper; local $Data::Dumper::Useqq = 1; print Dumper($s); }