Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Getting mad with CGI::Application and utf8

by Juerd (Abbot)
on Feb 26, 2008 at 20:43 UTC ( #670389=note: print w/replies, xml ) Need Help??

in reply to Getting mad with CGI::Application and utf8

[moritz] already pointed out that you shouldn't do _utf8_on. The :utf8 IO layer does the same thing and should also not be used. Using _utf8_on or :utf8 may result in serious malfunction and security holes.

  • Comment on Re: Getting mad with CGI::Application and utf8

Replies are listed 'Best First'.
Re^2: Getting mad with CGI::Application and utf8
by Anonymous Monk on May 15, 2008 at 18:37 UTC
    There is another aproach: one i use from time to time. Dont use perls borken utf-8 support. Pass the Argument -C0 to perl at the head of your script , and perl will treat all strings as raw binary. As long as you only break your strings on well defined boundaries, and dont attempt to naively count characters, it will work fine. If you need to truncate a string at a certain arbitrary point, such as "100 bytes" or so, you will have to make sure it stops at a well defined UTF-8 endpoint.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://670389]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-06-21 05:13 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.