Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2016-10-21 12:43 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (289 votes). Check out past polls.