homepage Welcome to WebmasterWorld Guest from 107.21.156.140
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library : Charter : Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Regexp Question/ advice needed
Regexp
Perllover




msg:4100329
 1:37 pm on Mar 18, 2010 (gmt 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

 

janharders




msg:4100382
 3:15 pm on Mar 18, 2010 (gmt 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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved