Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Regexp Question/ advice needed


1:37 pm on Mar 18, 2010 (gmt 0)

New User

10+ Year Member

joined:Jan 13, 2008
posts: 8
votes: 0

I made a regexp rule because Catalyst has some difficulties with uft8 and ISO etc.

It converts to: Ä ä Ö ö Ü ü ß on sending a form.

There is no way of decode so I wrote this rule:

$string =~ tr/[Ä,ä,Ö,ö,Ü,ü,ß]/[,,,,,,]/; $string =~ s///g;

But can anyone tell me is there is a simpler regexp?

Greetings from the Duch mountains,

Marco-Paul Breijer
3:15 pm on Mar 18, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 31, 2008
votes: 0

you could use something like
%replacethis = ('"' => '', '' => ''); # ... $string =~ s/(.)/$replacethis{ $1 }/egis;

to make it easier to maintain and read, but I doubt that it'll be quicker.
On the other hand, have you checked that it's really a bug?
I hate charsets because I often end up going the trial and error-route to make browser, script and database work side by side, but it'd be a surprise if Catalyst couldn't handle that. Does it set accept-charset on the form in question?