FAQ
Any clues what this means:

"Caught exception in engine "Wide character in syswrite at
/usr/share/perl5/Catalyst/Engine.pm line 675"

When I had a literal U+2032 (a U.S. "feet" measurement mark) in my tt file, Catalyst
didn't mind one bit. I moved that particular content into a model, and now it's expanded
into the Alloy template rather than being part of the template's own source. But Catalyst
shouldn't know the difference, right?

Now when I run, I get this error. Removing this one character from the data makes it go away.

What's the deal here?

Search Discussions

  • Jorge Gonzalez at Mar 23, 2011 at 7:45 am
    Did you add "use utf8;" at the beginning of your Model?

    */Jorge González Villalonga/*
    Director Técnico

    */DAIKON Integración y Desarrollo S.L./*
    Telf: (+34) 91 188 08 28
    Fax: (+34) 91 632 65 42
    *www.daikon.es*


    El 23/03/11 03:35, John M. Dlugosz escribió:
    Any clues what this means:

    "Caught exception in engine "Wide character in syswrite at
    /usr/share/perl5/Catalyst/Engine.pm line 675"

    When I had a literal U+2032 (a U.S. "feet" measurement mark) in my tt
    file, Catalyst didn't mind one bit. I moved that particular content
    into a model, and now it's expanded into the Alloy template rather
    than being part of the template's own source. But Catalyst shouldn't
    know the difference, right?

    Now when I run, I get this error. Removing this one character from
    the data makes it go away.

    What's the deal here?


    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    Skipped content of type multipart/related
  • John M. Dlugosz at Mar 23, 2011 at 9:03 am

    On 3/23/2011 2:45 AM, Jorge Gonzalez jorge.gonzalez-at-daikon.es |Catalyst/Allow to home| wrote:
    Did you add "use utf8;" at the beginning of your Model?
    No, I did not. I was just looking at that, and it means that the Perl source file itself
    is in utf8 so any string literals with non-ASCII values in them makes the string
    understood to be a UTF-8 encoding. It also changes the default upgrade/downgrade behavior
    for concatenating narrow and wide strings together, which only affects programs that are
    sensitive to precise meaning of "length" of the resulting string. That aspect is
    lexically scoped, and won't affect what's happening in "engine".
  • Bill Moseley at Mar 23, 2011 at 1:58 pm
    Post the smallest possible example (<20 lines?) that clearly shows the
    problem.


    --
    Bill Moseley
    moseley@hank.org
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110323/fb879369/attachment.htm
  • John M. Dlugosz at Mar 23, 2011 at 2:49 pm

    On 3/23/2011 8:58 AM, Bill Moseley moseley-at-hank.org |Catalyst/Allow to home| wrote:
    Post the smallest possible example (<20 lines?) that clearly shows the
    problem.
    OK, I verified that it still chokes if I strip it down to the bare essentials.
    If the view produces a stream that includes a wide character, I get the exception.

    Here is my Controller:
    ====
    package LEDft::Controller::Root;
    use Moose;
    use namespace::autoclean;
    use Mail::Builder::Simple;

    use Try::Tiny;

    BEGIN { extends 'Catalyst::Controller::HTML::FormFu' }

    #
    # Sets the actions in this controller to be registered with no prefix
    # so they function identically to actions created in MyApp.pm
    #
    __PACKAGE__->config(namespace => '');

    my %Data= (
    priceline => "10\x{2032} poll",
    );

    sub index :Path :Args(0) {
    my ( $self, $c ) = @_;
    $c->{stash}->{AdminContent}= \%Data;
    }


    sub end : ActionClass('RenderView') {}


    __PACKAGE__->meta->make_immutable;

    1;
    ====


    Here is the index.tt file:
    ====
    <p>[% AdminContent.priceline %]</p>

    ====

    Also, the app's config states: default_view => 'Alloy',
    So the tt file is being processed using Alloy. I get the same result if I use 'TT', the
    more common choice.

    =====================

    So, if the template produces a result that includes a "wide" character, I get the exception.
  • Nicholas Wehr at Mar 23, 2011 at 3:46 pm
    which platform are you testing on? windows mac linux?
    On Wed, Mar 23, 2011 at 7:49 AM, John M. Dlugosz wrote:

    On 3/23/2011 8:58 AM, Bill Moseley moseley-at-hank.org |Catalyst/Allow to
    home| wrote:
    Post the smallest possible example (<20 lines?) that clearly shows the
    problem.


    OK, I verified that it still chokes if I strip it down to the bare
    essentials.
    If the view produces a stream that includes a wide character, I get the
    exception.

    Here is my Controller:
    ====
    package LEDft::Controller::Root;
    use Moose;
    use namespace::autoclean;
    use Mail::Builder::Simple;

    use Try::Tiny;

    BEGIN { extends 'Catalyst::Controller::HTML::FormFu' }

    #
    # Sets the actions in this controller to be registered with no prefix
    # so they function identically to actions created in MyApp.pm
    #
    __PACKAGE__->config(namespace => '');

    my %Data= (
    priceline => "10\x{2032} poll",
    );

    sub index :Path :Args(0) {
    my ( $self, $c ) = @_;
    $c->{stash}->{AdminContent}= \%Data;
    }


    sub end : ActionClass('RenderView') {}


    __PACKAGE__->meta->make_immutable;

    1;
    ====


    Here is the index.tt file:
    ====
    <p>[% AdminContent.priceline %]</p>

    ====

    Also, the app's config states: default_view => 'Alloy',
    So the tt file is being processed using Alloy. I get the same result if I
    use 'TT', the more common choice.

    =====================

    So, if the template produces a result that includes a "wide" character, I
    get the exception.




    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110323/22b57a02/attachment.htm
  • Bill Moseley at Mar 23, 2011 at 6:00 pm

    On Wed, Mar 23, 2011 at 7:49 AM, John M. Dlugosz wrote:

    OK, I verified that it still chokes if I strip it down to the bare
    essentials.
    If the view produces a stream that includes a wide character, I get the
    exception.

    Here is my Controller:
    ====
    package LEDft::Controller::Root;
    use Moose;
    use namespace::autoclean;
    use Mail::Builder::Simple;

    use Try::Tiny;

    BEGIN { extends 'Catalyst::Controller::HTML::FormFu' }
    Mail::Builder::Simple, Try::Tiny, and FormFu is not needed for this example.

    If left out your app's configuration and showing what plugins you are using.
    That's the key bit information. Best if you post a really complete
    example.

    Here's some hints: try using Google. Search for the error you are seeing,
    and maybe add in the word "Catalyst". For example these keywords:

    Caught exception in engine "Wide character in syswrite" catalyst


    The first few posts you will find recommendations to add:
    "Unicode::Encoding" to your plugin list.




    --
    Bill Moseley
    moseley@hank.org
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110323/ecc0d1f0/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMar 23, '11 at 2:35a
activeMar 23, '11 at 6:00p
posts7
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase