Re: [Catalyst] Wide (Unicode) character problem?

2011-03-23 Thread Bill Moseley
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
mose...@hank.org
___
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/


Re: [Catalyst] Wide (Unicode) character problem?

2011-03-23 Thread Nicholas Wehr
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:
> 
> [% AdminContent.priceline %]
>
> 
>
> 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/
>
___
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/


Re: [Catalyst] Wide (Unicode) character problem?

2011-03-23 Thread John M. Dlugosz

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:

[% AdminContent.priceline %]



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/


Re: [Catalyst] Wide (Unicode) character problem?

2011-03-23 Thread Bill Moseley
Post the smallest possible example (<20 lines?) that clearly shows the
problem.


-- 
Bill Moseley
mose...@hank.org
___
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/


Re: [Catalyst] Wide (Unicode) character problem?

2011-03-23 Thread John M. Dlugosz
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".





___
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/


Re: [Catalyst] Wide (Unicode) character problem?

2011-03-23 Thread Jorge Gonzalez




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/
  



___
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/


[Catalyst] Wide (Unicode) character problem?

2011-03-22 Thread John M. Dlugosz

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/