[Catalyst-dev] A try to patch Catalyst::Engine.pm

Chae Lee yuand2 at gmail.com
Wed Jul 30 01:47:54 BST 2008


On Tue, Jul 29, 2008 at 10:29 AM, Jonathan Rockway <jon at jrock.us> wrote:

> * On Mon, Jul 28 2008, Chae Lee wrote:
> > hi,
> >
> > in version 5.7014, I changed a few lines of Engine.pm as below.
> Engine_1.pm is
> > the original and Engine.pm is the modified.
> >
> > I did because of the warning "wide char..." when using test http
> server(in
> > Catalyst dist); some are in byte string and others are in character
> string for
> > output in my website.
>
> Why are wide characters in the output buffer?  The network cannot
> transfer Perl wide characters; you need to convert them to bytes with
> Encode::encode first.  ("use bytes" is not acceptable.)


Yeah, I almost always use Encode.pm, but Engine.pm is special. it shouldn't
bother 'output'; it should just copy the output to the web browser
byte-by-byte. To make sure "byte-by-byte" (perl implicitly tries encoding),
I injected "use bytes;"


Catalyst::Plugin::Unicode automates this.  Are you using that?
>
>
I didn't consider of the plugin simply because of the name "Unicode." Today
I looked at the code. Good! but drawbacks:

1. the plugin deals with ONLY utf8.

2. effective ONLY on the test server in Catalyst dist. If I apply the plugin
to, say Lighttpd, it happens to be purely an overhead.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst-dev/attachments/20080729/1=
ab78bd4/attachment.htm


More information about the Catalyst-dev mailing list