Re: [mp2] utf8 data garbled on second + subsequent loads
[prev]
[thread]
[next]
[Date index for 2005/02/11]
Thanks
I'll give that a go. What OS are you on out of interest. As I just
decided to try in on one of my Linux servers and I'm not having that
problem there at all. So I'm now wondering if its a bug in a specific
version or maybe even OS X.
Thanks
Angie
On Fri, 11 Feb 2005 13:56:55 +0100, Roman Va=C5=A1=C3=AD=C4=8Dek <rv@petame=
m.com> wrote:
> It is strange. CGI works ok, but i was unable to get correct output even
> from module even first time. It seems to be ok for me after switching
> from perl-script to modperl handler.
>=20
> apache 2.0.48
> mod_perl 1.99_14
> perl 5.0.8
>=20
> <Location /unitest>
> SetHandler modperl
> # perl-script does not work - don't know why
> # SetHandler perl-script
> PerlResponseHandler Unitest
> </Location>
>=20
> Here is changed handler and startpage code
>=20
> sub handler {
> my $r =3D shift;
> $r->print( header(-type =3D> "text/html", -charset =3D> "utf-8"));
> $r->print( start_html(
> # This seems to be no important?
> -encoding =3D> 'utf-8',
> -title =3D> "Simple UTF 8 test"));
> $r->print( "\n\n");
> # page calls
> unless (param('VertDo')) {
> $r->print(&startpage());
> }
> $r->print( "\n\n", end_html);
> return Apache::OK;
> #1;
> }
>=20
> sub startpage {
> my %uni =3D &unihash;
> my $p =3D '';
> $p =3D "\n";
> $p .=3D start_form(-method=3D>"get", -action=3D>"/test.html");
> $p .=3D h1("Unicode test: Page 1");
> $p .=3D '<table border=3D"1" cellpadding=3D"5">';
> my $tablinedef =3D "<tr>" . "<td>%s</td>" x 3 . "</tr>\n";
> # Headerline
> $p .=3D sprintf $tablinedef,
> "description", "language", "char in unicode";
> foreach (sort keys %uni) {
> $p .=3D sprintf $tablinedef,
> $_ ,
> $uni{$_}->{language},
> textfield(-name=3D>$_,
> -default=3D>$uni{$_}->{character}, -size=3D>50, -maxl=
ength=3D>80);
> }
> $p .=3D '</table>';
> $p .=3D hidden(-name=3D>'VertDo',
> -default=3D>['test unicode']);
> $p .=3D submit(-name=3D>'Do',
> -value=3D>'test unicode');
> $p .=3D endform;
> return $p;
> }
>=20
> Hope it helps
> Roman
>=20
> On Fri, Feb 11, 2005 at 11:47:49AM +0000, angie ahl wrote:
> > I've looked into it further and stripped it right back to the start.
> >
> > Now I just have the unicode chars hard coded in the script and
> > printing them to a table.
> >
> > I'm not even passing them through a form now, just printing them.
> >
> > In CGI mode it works perfectly and in MP2 mode it loads fine the first
> > time after apache or the browser is restarted. Then goes kaboom, ie
> > gibberish
> >
> > Here's both scripts.
> [...]
>=20
> --
> best regards
> Ing. Roman Vasicek
>=20
> software developer
> +------------------------------------------------------------------------=
----+
> PetaMem s.r.o., Ocelarska 1, 190 00 Praha 9 - Liben, Czech Republic
> http://www.petamem.com/
>