Results tagged “percent-encoding”

rocks near Greens Fork, Indiana
In my [previous post]( I summarized the current state of Percent-encoding in Perl. One of my conclusions was that the perfect percent-encoding solution would automatically handle UTF-8 encoding, using logic like this: utf8::encode $string if utf8::is_utf8 $string; Respected Plack author miyagawa quickly responded [in a response post]( to say that the above code approach is a bug, although the code pattern is already wide use as it is present in Catalyst, (and by extension CGI::Application and other frameworks) as well as Mojo. In one sense, he's right. The pattern goes against the advice found in the official [perlunifaq]( documentation which states that > It's better to pretend that the internal format is some unknown encoding, and > that you always have to encode and decode explicitly. In other words: don't use the "is_utf8()" function. Before drawing a conclusion whether this code pattern is the best design in *in practice,* let's look some related facts about the matter.