the "use utf8" pragma is to tell Perl that your *source code* is in UTF8.
 While this can be important, I don't actually have any non-ASCII text in
any of my source code.

What I have done is rebuilt the component to use straight perl instead of
Mason, and have it invoked under ModPerl::Registry.  The data now comes out
just fine.  From this it is pretty clear (to me) that my Mason output is
getting processed again on the way out, but I have no idea by which of the
myriad of pieces in the puzzle.  I know it is important to sort this out,
but for right now I am just happy I can ship a solution to my very crabby
customer.


On Fri, Mar 21, 2014 at 8:17 AM, <7egg...@gmx.de> wrote:

> On Wed, 19 Mar 2014, Shane McCarron wrote:
>
> > (This message is about Mason 1.)
>
> > If a string contains UTF-8 data, that data appears to be correct while
> > processing (I can log it and it comes out as you would expect), and when
> I
> > generate the json with to_json it is also still correct.  However, when
> the
> > data is sent to Apache via $m->out, it gets encoded into UTF-8 AGAIN (so
> > the UTF-8 characters become escaped ASCII effectively).  But this ONLY
> > happens when $m->out sends the data out via mod_perl.  When in CGI mode
> it
> > is perfect.
>
> I don't remember the exact UTF8 issue I had, but I fixed it by using
> "use utf8":
>
> <IfModule mod_perl.c>
>         PerlModule HTML::Mason::ApacheHandler
>         PerlSetVar MasonPreamble "use utf8;"
>         <FilesMatch "\.hpl$">
>                 SetHandler perl-script
>                 PerlHandler HTML::Mason::ApacheHandler
>         </FilesMatch>
> </IfModule>
>
>


-- 
Shane McCarron
halindr...@gmail.com
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to