<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-19245</id>
	<title>Nabble - Catalyst Web Framework</title>
	<updated>2009-11-24T12:31:18Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Catalyst-Web-Framework-f19245.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Catalyst-Web-Framework-f19245.html" />
	<subtitle type="html">&lt;a href=&quot;http://www.catalystframework.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst&lt;/a&gt; -- The elegant MVC web framework.&lt;br&gt;
Catalyst is designed to make it easy to manage the various tasks you need to do to run an application on the web, either by doing them itself, or by letting you &quot;plug in&quot; existing Perl modules that do what you need.&lt;br&gt;</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26502820</id>
	<title>Organize tests in sub-directories</title>
	<published>2009-11-24T12:31:18Z</published>
	<updated>2009-11-24T12:31:18Z</updated>
	<author>
		<name>Octavian Râşniţă</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I would like to structure the t directory as lib/MyApp is structured. Is it 
&lt;br&gt;possible to be able to configure the app somehow so `make test` checks all 
&lt;br&gt;the test files even if they are in sub-directories?
&lt;br&gt;&lt;br&gt;`prove -r -l t` can do this, but it works well only under Linux or if I also 
&lt;br&gt;add the -j parameter and a big enough number of parallel jobs, so I'm not 
&lt;br&gt;sure it will always work.
&lt;br&gt;&lt;br&gt;Thanks.
&lt;br&gt;&lt;br&gt;Octavian
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26502820&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Organize-tests-in-sub-directories-tp26502820p26502820.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26499337</id>
	<title>Re: Unicode trouble with Catalyst::Engine::FastCGI</title>
	<published>2009-11-24T08:41:03Z</published>
	<updated>2009-11-24T08:41:03Z</updated>
	<author>
		<name>Aristotle Pagaltzis</name>
	</author>
	<content type="html">* Tomas Doran &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26499337&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bobtfish@...&lt;/a&gt;&amp;gt; [2009-11-23 23:20]:
&lt;br&gt;&amp;gt; This probably means (I'm guessing) that the xs part of FCGI
&lt;br&gt;&amp;gt; doesn't correctly handle buffers which are characters rather
&lt;br&gt;&amp;gt; than bytes.
&lt;br&gt;&lt;br&gt;That was my initial guess.
&lt;br&gt;&lt;br&gt;&amp;gt; We can get this fixed, but not without test cases, and I'm
&lt;br&gt;&amp;gt; struggling to reproduce the issue here.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Help?
&lt;br&gt;&lt;br&gt;Glad that Bernhard stepped up because I’ve never used FCGI. :-)
&lt;br&gt;&lt;br&gt;&lt;br&gt;* Bernhard Graf &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26499337&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;catalyst4@...&lt;/a&gt;&amp;gt; [2009-11-24 13:40]:
&lt;br&gt;&amp;gt; As a quick fix, we could utf8::downgrade($buffer) in
&lt;br&gt;&amp;gt; Catalyst::Engine::FastCGI right before syswrite. Doesn't hurt,
&lt;br&gt;&amp;gt; as far as I understand.
&lt;br&gt;&lt;br&gt;It wouldn’t even necessarily be a quick fix in this case, IMO. It
&lt;br&gt;would be preferrable to fix it in FCGI, but if the maintainer is
&lt;br&gt;gone and a new version is not likely to happen, then downgrading
&lt;br&gt;in the FastCGI engine would be the correct and proper fix. Any
&lt;br&gt;fix in the XS code would effectively imply a transient downgrade
&lt;br&gt;anyway. If the body string represents an encoded octet sequence,
&lt;br&gt;then downgrading will always succeed, as well.
&lt;br&gt;&lt;br&gt;(If it’s not downgradeable, then the engine should probably throw
&lt;br&gt;an exception, as mentioned in the other thread.)
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;-- 
&lt;br&gt;Aristotle Pagaltzis // &amp;lt;&lt;a href=&quot;http://plasmasturm.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plasmasturm.org/&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26499337&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unicode-trouble-with-Catalyst%3A%3AEngine%3A%3AFastCGI-tp26476878p26499337.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26495152</id>
	<title>Re: Re: Unicode trouble with Catalyst::Engine::FastCGI</title>
	<published>2009-11-24T04:32:35Z</published>
	<updated>2009-11-24T04:32:35Z</updated>
	<author>
		<name>Bernhard Graf-6</name>
	</author>
	<content type="html">Tomas Doran schrieb:
&lt;br&gt;&lt;br&gt;&amp;gt; The FastCGI engine doesn't do anything with encoding/uft8, and nor does
&lt;br&gt;&amp;gt; FCGI.pm
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This probably means (I'm guessing) that the xs part of FCGI doesn't
&lt;br&gt;&amp;gt; correctly handle buffers which are characters rather than bytes.
&lt;br&gt;&lt;br&gt;I wrote a test program to keep all possible side effects away.
&lt;br&gt;It is here &lt;a href=&quot;http://scsys.co.uk:8001/36569&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://scsys.co.uk:8001/36569&lt;/a&gt;&amp;nbsp;and it shows (using option -u),
&lt;br&gt;that FCGI indeed encodes all data as soon as the utf-8 flag is on.
&lt;br&gt;&lt;br&gt;This is very interesting, because the latest FCGI release is nearly
&lt;br&gt;seven years old. Did the utf-8 flag exist at that time at all?
&lt;br&gt;Is there something in Perl's guts that does such encoding automatically?
&lt;br&gt;&lt;br&gt;&amp;gt; We can get this fixed, but not without test cases, and I'm struggling to
&lt;br&gt;&amp;gt; reproduce the issue here.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Help?
&lt;br&gt;&lt;br&gt;I know hardly anything about Perl XS code. Maybe someone with a clue
&lt;br&gt;could have a look at FCGI.xs^H^HXL?
&lt;br&gt;&lt;br&gt;As a quick fix, we could utf8::downgrade($buffer) in
&lt;br&gt;Catalyst::Engine::FastCGI right before syswrite. Doesn't hurt, as far as
&lt;br&gt;I understand.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Bernhard
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26495152&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unicode-trouble-with-Catalyst%3A%3AEngine%3A%3AFastCGI-tp26476878p26495152.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26493329</id>
	<title>Re: [ANNOUNCE] CALL FOR TESTING Catalyst-Runtime  5.80014_01</title>
	<published>2009-11-24T02:04:14Z</published>
	<updated>2009-11-24T02:04:14Z</updated>
	<author>
		<name>Vladimir Timofeev</name>
	</author>
	<content type="html">At first glance all ok. I can't find any encoding issues with my
&lt;br&gt;application (all templates and data in koi8-r). But I do not try to
&lt;br&gt;print any chars, all data - bytes.
&lt;br&gt;&lt;br&gt;On Tue, Nov 24, 2009 at 02:54, Tomas Doran &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26493329&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bobtfish@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hot on the heels of Catalyst-Runtime 5.80014, I'd like to announce a
&lt;br&gt;&amp;gt; development release, Catalyst 5.80014_01.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This release has a potentially behavior changing fix for the CGI and FastCGI
&lt;br&gt;&amp;gt; engines to do with outputting UTF-8. This fixes a serious bug with
&lt;br&gt;&amp;gt; outputting utf-8 pages using Catalyst::Plugin::Unicode::Encoding at least..
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I _NEED_ people using FastCGI and dealing with high bit characters in their
&lt;br&gt;&amp;gt; applications to test this release for me and let me know if they see any
&lt;br&gt;&amp;gt; issues. If you do see any issues in your app which previously worked with
&lt;br&gt;&amp;gt; any other 5.80 version, please reply to this mail or log a bug in RT.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You can try it out by typing:
&lt;br&gt;&amp;gt; cpan -i BOBTFISH/Catalyst-5.80014_01.tar.gz
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The changelog is included below as usual. Thanks in advance to anyone
&lt;br&gt;&amp;gt; helping test this release.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cheers
&lt;br&gt;&amp;gt; t0m
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; 5.80014_01 2009-11-22 20:01:23
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  Bug fixes:
&lt;br&gt;&amp;gt;   - Filehandle now forced to binmode in CGI and FastCGI engines. This
&lt;br&gt;&amp;gt; appears
&lt;br&gt;&amp;gt;     to correct some UTF-8 issues, but may break people's code which relies
&lt;br&gt;&amp;gt;     on the old behaviour.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  Refactoring / cleanups:
&lt;br&gt;&amp;gt;   - Plugins which inherit from Catalyst::Controller or Catalyst::Component
&lt;br&gt;&amp;gt;     are deprecated and now issue warnings.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26493329&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;&amp;gt; Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;&amp;gt; Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;-- vovkasm
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26493329&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-ANNOUNCE--CALL-FOR-TESTING-Catalyst-Runtime-5.80014_01-tp26488311p26493329.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26493118</id>
	<title>Re: [Catalyst-dev] [ANNOUNCE] CALL FOR TESTING Catalyst-Runtime 5.80014_01</title>
	<published>2009-11-24T01:36:33Z</published>
	<updated>2009-11-24T01:36:33Z</updated>
	<author>
		<name>Frank Wiegand</name>
	</author>
	<content type="html">Am Montag, den 23.11.2009, 23:54 +0000 schrieb Tomas Doran:
&lt;br&gt;&amp;gt; You can try it out by typing:
&lt;br&gt;&amp;gt; cpan -i BOBTFISH/Catalyst-5.80014_01.tar.gz
&lt;br&gt;&lt;br&gt;Setting TEST_HTTP=1 and TEST_THREADS=1, I got two test errors:
&lt;br&gt;&lt;br&gt;t/optional_http-server-restart.t ...................................... Can't locate Catalyst/Engine/HTTP/Restarter/Watcher.pm in @INC (@INC contains: /home/fw/tmp/Catalyst-Runtime-5.80014_01/inc /home/fw/tmp/Catalyst-Runtime-5.80014_01/blib/lib /home/fw/tmp/Catalyst-Runtime-5.80014_01/blib/arch /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at t/optional_http-server-restart.t line 16.
&lt;br&gt;BEGIN failed--compilation aborted at t/optional_http-server-restart.t line 16.
&lt;br&gt;t/optional_http-server-restart.t ...................................... Dubious, test returned 2 (wstat 512, 0x200)
&lt;br&gt;No subtests run
&lt;br&gt;&lt;br&gt;and
&lt;br&gt;&lt;br&gt;t/optional_threads.t .................................................. 1/3
&lt;br&gt;# &amp;nbsp; Failed test 'Executed actions'
&lt;br&gt;# &amp;nbsp; at t/optional_threads.t line 54.
&lt;br&gt;# &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;got: 'TestApp::Controller::Action::Default-&amp;gt;begin, TestApp::Controller::Action::Default-&amp;gt;default, TestApp::View::Dump::Request-&amp;gt;process, TestApp::Controller::Root-&amp;gt;end'
&lt;br&gt;# &amp;nbsp; &amp;nbsp; expected: 'TestApp::Controller::Action::Default-&amp;gt;begin, TestApp::Controller::Action::Default-&amp;gt;default, TestApp::View::Dump::Request-&amp;gt;process, TestApp-&amp;gt;end'
&lt;br&gt;# Looks like you failed 1 test of 3.
&lt;br&gt;t/optional_threads.t .................................................. Dubious, test returned 1 (wstat 256, 0x100)
&lt;br&gt;Failed 1/3 subtests
&lt;br&gt;&lt;br&gt;The last one already has a ticket at &lt;a href=&quot;http://rt.cpan.org/Public/Bug/Display.html?id=50039&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rt.cpan.org/Public/Bug/Display.html?id=50039&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Bye, Frank
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26493118&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-ANNOUNCE--CALL-FOR-TESTING-Catalyst-Runtime-5.80014_01-tp26488311p26493118.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26488311</id>
	<title>[ANNOUNCE] CALL FOR TESTING Catalyst-Runtime 5.80014_01</title>
	<published>2009-11-23T15:54:14Z</published>
	<updated>2009-11-23T15:54:14Z</updated>
	<author>
		<name>Tomas Doran</name>
	</author>
	<content type="html">Hot on the heels of Catalyst-Runtime 5.80014, I'd like to announce a &amp;nbsp;
&lt;br&gt;development release, Catalyst 5.80014_01.
&lt;br&gt;&lt;br&gt;This release has a potentially behavior changing fix for the CGI and &amp;nbsp;
&lt;br&gt;FastCGI engines to do with outputting UTF-8. This fixes a serious bug &amp;nbsp;
&lt;br&gt;with outputting utf-8 pages using Catalyst::Plugin::Unicode::Encoding &amp;nbsp;
&lt;br&gt;at least..
&lt;br&gt;&lt;br&gt;I _NEED_ people using FastCGI and dealing with high bit characters in &amp;nbsp;
&lt;br&gt;their applications to test this release for me and let me know if they &amp;nbsp;
&lt;br&gt;see any issues. If you do see any issues in your app which previously &amp;nbsp;
&lt;br&gt;worked with any other 5.80 version, please reply to this mail or log a &amp;nbsp;
&lt;br&gt;bug in RT.
&lt;br&gt;&lt;br&gt;You can try it out by typing:
&lt;br&gt;cpan -i BOBTFISH/Catalyst-5.80014_01.tar.gz
&lt;br&gt;&lt;br&gt;The changelog is included below as usual. Thanks in advance to anyone &amp;nbsp;
&lt;br&gt;helping test this release.
&lt;br&gt;&lt;br&gt;Cheers
&lt;br&gt;t0m
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;5.80014_01 2009-11-22 20:01:23
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Bug fixes:
&lt;br&gt;&amp;nbsp; &amp;nbsp; - Filehandle now forced to binmode in CGI and FastCGI engines. &amp;nbsp;
&lt;br&gt;This appears
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; to correct some UTF-8 issues, but may break people's code which &amp;nbsp;
&lt;br&gt;relies
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; on the old behaviour.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Refactoring / cleanups:
&lt;br&gt;&amp;nbsp; &amp;nbsp; - Plugins which inherit from Catalyst::Controller or &amp;nbsp;
&lt;br&gt;Catalyst::Component
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; are deprecated and now issue warnings.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26488311&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-ANNOUNCE--CALL-FOR-TESTING-Catalyst-Runtime-5.80014_01-tp26488311p26488311.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26488225</id>
	<title>Re: How to reduce the memory footprint?</title>
	<published>2009-11-23T15:39:00Z</published>
	<updated>2009-11-23T15:39:00Z</updated>
	<author>
		<name>Rodrigo-51</name>
	</author>
	<content type="html">&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 23, 2009 at 10:45 PM, J. Shirley &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26488225&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jshirley@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;div class=&quot;gmail_quote&quot;&gt;&lt;br&gt;&lt;div&gt;I wouldn&amp;#39;t trust the output of top/ps to determine how much memory is used.&lt;br&gt;&lt;br&gt;-J&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;I do. &lt;br&gt;Not for individual processes, though. But for the totals top is perfectly fine for me. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
I
don&amp;#39;t have many other processes running on the box. If I turn off
catalyst, I use less than 250MB or memory. With Catalyst, I&amp;#39;m over
800MB with some occasional swapping.&lt;div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;When you say you go from less than 250 to over 800MB, it seems a little too much. What does &amp;quot;small app&amp;quot; mean in this case?&lt;br&gt;
&lt;br&gt;My ubuntu box does not have swapping (it&amp;#39;s OpenVZ), when it goes over my allocated 256MB ram, out-of-memory hell breaks loose. So what I&amp;#39;m watching for is actually my total free memory. &lt;br&gt;&lt;br&gt;Before starting up my Catalyst app:&lt;br&gt;
&lt;br&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;top - 23:16:01 up 14 days,  4:57,  1 user,  load average: 0.02, 0.02, 0.00&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Tasks:  23 total,   2 running,  21 sleeping,   0 stopped,   0 zombie&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Mem:    262144k total,    25720k used,   &lt;b&gt;236424k&lt;/b&gt; &lt;b&gt;free&lt;/b&gt;,        0k buffers&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Swap:        0k total,        0k used,        0k free,        0k cached&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;After startup (out-of-the-box HTTP::Prefork, small app), 30MB are gone:&lt;br&gt;&lt;br&gt;
&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;top - 23:14:36 up 14 days,  4:56,  1 user,  load average: 0.07, 0.03, 0.01&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Tasks:  29 total,   2 running,  27 sleeping,   0 stopped,   0 zombie&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Mem:    262144k total,    55448k used,   &lt;b&gt;206696k&lt;/b&gt; &lt;b&gt;free&lt;/b&gt;,        0k buffers&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Swap:        0k total,        0k used,        0k free,        0k cached&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                         &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3637 catw      18   0 28448  24m 1524 S  0.0  9.5   0:00.00 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3673 catw      20   0 28448  23m  748 S  0.0  9.2   0:00.00 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3675 catw      20   0 28448  23m  628 S  0.0  9.2   0:00.00 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3676 catw      20   0 28448  23m  628 S  0.0  9.2   0:00.00 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3677 catw      24   0 28448  23m  628 S  0.0  9.2   0:00.00 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;/font&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;font size=&quot;1&quot;&gt; 3678 catw      25   0 28448  23m  628 S  0.0  9.2   0:00.00 perl        &lt;/font&gt;    &lt;/span&gt;&lt;br&gt;&lt;br&gt;After a few thousand hits, total mem usage seems to level out at 62MB:&lt;br&gt;
&lt;font size=&quot;1&quot;&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;top - 23:48:13 up 14 days,  5:29,  1 user,  load average: 0.02, 0.02, 0.00&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Tasks:  29 total,   2 running,  27 sleeping,   0 stopped,   0 zombie&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Mem:    262144k total,    87264k used,   &lt;b&gt;174880k free&lt;/b&gt;,        0k buffers&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;Swap:        0k total,        0k used,        0k free,        0k cached&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                         &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3637 catw      15   0 28560  24m 1524 S  0.0  9.5   0:00.01 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3673 catw      15   0 29320  25m 1616 S  0.0  9.9   0:00.24 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3675 catw      15   0 29308  25m 1616 S  0.0  9.9   0:00.28 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3676 catw      15   0 29308  25m 1616 S  0.0  9.9   0:00.25 perl                                                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3677 catw      15   0 29308  25m 1616 S  0.0  9.9   0:00.20 perl                                                                             &lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt; 3678 catw      15   0 29244  25m 1616 S  0.0  9.9   0:00.22 perl&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;Maybe the Catalyst wiki should have some profiling and performance oriented info. That way people can have an idea on how to measure and what to expect from their apps. And what to expect after using some of the most popular modules (ie DBIC). &lt;br&gt;
&lt;br&gt;-rodrigo&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26488225&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-reduce-the-memory-footprint--tp26483372p26488225.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26487462</id>
	<title>Re: How to reduce the memory footprint?</title>
	<published>2009-11-23T14:39:39Z</published>
	<updated>2009-11-23T14:39:39Z</updated>
	<author>
		<name>Dave Rolsky</name>
	</author>
	<content type="html">On Mon, 23 Nov 2009, Julien Sobrier wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; I run 5 instances of FastCGI. Each instance was taking about 90MB of memory.
&lt;br&gt;&amp;gt; I tried to reduce the memory fooprint by reducing the number of libraries I
&lt;br&gt;&amp;gt; used. The memory usage is now 120MB per instance! The memory increase is
&lt;br&gt;&amp;gt; probably due to other changes.
&lt;br&gt;&lt;br&gt;If you can, take a look at smem (&lt;a href=&quot;http://www.selenic.com/smem/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.selenic.com/smem/&lt;/a&gt;) to see how 
&lt;br&gt;much memory these procs are _really_ using.
&lt;br&gt;&lt;br&gt;This tool looks at how much memory is shared between procs and gives you a 
&lt;br&gt;much better sense of how much memory it costs _per process_.
&lt;br&gt;&lt;br&gt;But you need to be on a relatively recent Linux kernel to use it.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-dave
&lt;br&gt;&lt;br&gt;/*============================================================
&lt;br&gt;&lt;a href=&quot;http://VegGuide.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://VegGuide.org&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://blog.urth.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.urth.org&lt;/a&gt;&lt;br&gt;Your guide to all that's veg &amp;nbsp; &amp;nbsp; &amp;nbsp;House Absolute(ly Pointless)
&lt;br&gt;============================================================*/
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487462&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-reduce-the-memory-footprint--tp26483372p26487462.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26487135</id>
	<title>Re: Re: Unicode trouble with Catalyst::Engine::FastCGI</title>
	<published>2009-11-23T14:23:17Z</published>
	<updated>2009-11-23T14:23:17Z</updated>
	<author>
		<name>Tomas Doran</name>
	</author>
	<content type="html">&lt;br&gt;On 23 Nov 2009, at 21:15, Aristotle Pagaltzis wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; * Bernhard Graf &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487135&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;catalyst4@...&lt;/a&gt;&amp;gt; [2009-11-23 20:00]:
&lt;br&gt;&amp;gt;&amp;gt; Aristotle Pagaltzis schrieb:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; While this fixes the problem, it is still unclear, why the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; utf8 flag is set for the whole buffer.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; It shouldn’t matter.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; But it does.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; yes, because ::FastCGI is broken. :-) &amp;nbsp;Is what I’m saying.
&lt;/div&gt;&lt;br&gt;The FastCGI engine doesn't do anything with encoding/uft8, and nor &amp;nbsp;
&lt;br&gt;does FCGI.pm
&lt;br&gt;&lt;br&gt;This probably means (I'm guessing) that the xs part of FCGI doesn't &amp;nbsp;
&lt;br&gt;correctly handle buffers which are characters rather than bytes.
&lt;br&gt;&lt;br&gt;We can get this fixed, but not without test cases, and I'm struggling &amp;nbsp;
&lt;br&gt;to reproduce the issue here.
&lt;br&gt;&lt;br&gt;Help?
&lt;br&gt;&lt;br&gt;Cheers
&lt;br&gt;t0m
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487135&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unicode-trouble-with-Catalyst%3A%3AEngine%3A%3AFastCGI-tp26476878p26487135.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26487079</id>
	<title>Re: Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T14:20:05Z</published>
	<updated>2009-11-23T14:20:05Z</updated>
	<author>
		<name>Tomas Doran</name>
	</author>
	<content type="html">&lt;br&gt;On 23 Nov 2009, at 18:24, Marc SCHAEFER wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; On Mon, Nov 23, 2009 at 05:43:25PM +0100, Aristotle Pagaltzis wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; I had an IRC convo with Tomas Doran last night and explained the
&lt;br&gt;&amp;gt;&amp;gt; problem to him. He knocked out some tests for the broken
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thank you for your time! &amp;nbsp;It's nice to see the responsiveness of the
&lt;br&gt;&amp;gt; project.
&lt;br&gt;&lt;br&gt;Now fixed in trunk:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://dev.catalystframework.org/svnweb/Catalyst/revision?rev=11978&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalystframework.org/svnweb/Catalyst/revision?rev=11978&lt;/a&gt;&lt;br&gt;&lt;br&gt;Please test it out for me to ensure this does fix your issue as &amp;nbsp;
&lt;br&gt;expected?
&lt;br&gt;&lt;br&gt;Cheers
&lt;br&gt;t0m
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487079&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26487079.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26486575</id>
	<title>Re: How to reduce the memory footprint?</title>
	<published>2009-11-23T13:45:41Z</published>
	<updated>2009-11-23T13:45:41Z</updated>
	<author>
		<name>J. Shirley</name>
	</author>
	<content type="html">&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 23, 2009 at 1:25 PM, Julien Sobrier &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486575&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;julien@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Right, nprocs=5&lt;br&gt;&lt;br&gt;I thought 100M RES/300M VIRT meanst 100M per process, and 300M shard among perl processes.&lt;br&gt;&lt;br&gt;I don&amp;#39;t have many other processes running on the box. If I turn off catalyst, I use less than 250MB or memory. With Catalyst, I&amp;#39;m over 800MB with some occasional swapping.&lt;div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;How are you profiling your app (and determining how much memory is &amp;quot;free&amp;quot;)?   You can profile the memory usage of your app using the development server and get a very good idea of where the memory usage is at.&lt;br&gt;
&lt;br&gt;I wouldn&amp;#39;t trust the output of top/ps to determine how much memory is used.&lt;br&gt;&lt;br&gt;-J&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486575&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-reduce-the-memory-footprint--tp26483372p26486575.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26486550</id>
	<title>Re: How to reduce the memory footprint?</title>
	<published>2009-11-23T13:44:15Z</published>
	<updated>2009-11-23T13:44:15Z</updated>
	<author>
		<name>Peter Karman</name>
	</author>
	<content type="html">Julien Sobrier wrote on 11/23/2009 03:25 PM:
&lt;br&gt;&amp;gt; Right, nprocs=5
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I thought 100M RES/300M VIRT meanst 100M per process, and 300M shard
&lt;br&gt;&amp;gt; among perl processes.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I don't have many other processes running on the box. If I turn off
&lt;br&gt;&amp;gt; catalyst, I use less than 250MB or memory. With Catalyst, I'm over 800MB
&lt;br&gt;&amp;gt; with some occasional swapping.
&lt;br&gt;&lt;br&gt;that amount of memory use doesn't seem excessive to me. I've had 250+MB
&lt;br&gt;per process before for larger apps.
&lt;br&gt;&lt;br&gt;If you have only that much memory (~1G) available, do you really need to
&lt;br&gt;be running 5 procs? Why not 2 or 3? If you run into bottlenecks with 3
&lt;br&gt;preforked processes on your current hw, you'll need to be looking at
&lt;br&gt;upgrading your hardware anyway.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Peter Karman &amp;nbsp;. &amp;nbsp;&lt;a href=&quot;http://peknet.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://peknet.com/&lt;/a&gt;&amp;nbsp; . &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486550&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486550&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-reduce-the-memory-footprint--tp26483372p26486550.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26486247</id>
	<title>Re: How to reduce the memory footprint?</title>
	<published>2009-11-23T13:25:05Z</published>
	<updated>2009-11-23T13:25:05Z</updated>
	<author>
		<name>Julien Sobrier</name>
	</author>
	<content type="html">Right, nprocs=5&lt;br&gt;&lt;br&gt;I thought 100M RES/300M VIRT meanst 100M per process, and 300M shard among perl processes.&lt;br&gt;&lt;br&gt;I don&amp;#39;t have many other processes running on the box. If I turn off catalyst, I use less than 250MB or memory. With Catalyst, I&amp;#39;m over 800MB with some occasional swapping.&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 23, 2009 at 1:00 PM, Tomas Doran &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486247&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bobtfish@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
On 23 Nov 2009, at 18:18, Julien Sobrier wrote:&lt;br&gt;
&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Hello,&lt;br&gt;
I have quite a small Catalyst application that runs with FastCGI +  FCGI::ProcManager::MaxRequests&lt;br&gt;
&lt;br&gt;
I run 5 instances of FastCGI. Each instance was taking about 90MB of memory. I tried to reduce the memory fooprint by reducing the number of libraries I used. The memory usage is now 120MB per instance! The memory increase is probably due to other changes.&lt;br&gt;

&lt;/blockquote&gt;
&lt;br&gt;&lt;/div&gt;
When you say &amp;#39;5 instances&amp;#39;, you mean you have nprocs = 5, right?&lt;br&gt;
&lt;br&gt;
This _isn&amp;#39;t_ using 100Mb per instance - all of the application is loaded into memory before fork() is called, so it will mostly be shared (by copy on write) memory.&lt;br&gt;
&lt;br&gt;
Cheers&lt;br&gt;
t0m&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486247&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;&lt;br&gt;
Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;
Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;
Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486247&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-reduce-the-memory-footprint--tp26483372p26486247.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26486045</id>
	<title>Re: Unicode trouble with Catalyst::Engine::FastCGI</title>
	<published>2009-11-23T13:15:05Z</published>
	<updated>2009-11-23T13:15:05Z</updated>
	<author>
		<name>Aristotle Pagaltzis</name>
	</author>
	<content type="html">Hi Bernhard,
&lt;br&gt;&lt;br&gt;* Bernhard Graf &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486045&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;catalyst4@...&lt;/a&gt;&amp;gt; [2009-11-23 20:00]:
&lt;br&gt;&amp;gt; Aristotle Pagaltzis schrieb:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; While this fixes the problem, it is still unclear, why the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; utf8 flag is set for the whole buffer.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; It shouldn’t matter.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But it does.
&lt;br&gt;&lt;br&gt;yes, because ::FastCGI is broken. :-) &amp;nbsp;Is what I’m saying.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; So Ladies and Gentleman, may I present you the culprit? It
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; is YAML::XS! Everything read by YAML::XS
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; perl -MYAML::XS -E '
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; my $config = YAML::XS::LoadFile(&amp;quot;myapp.yml&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; say((utf8::is_utf8($config-&amp;gt;{name}) ? &amp;quot;is&amp;quot; : &amp;quot;is not&amp;quot;), &amp;quot; utf8&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; '
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; is utf8
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; No, that’s not the culprit.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The culprit is Catalyst::Engine::FastCGI, which does not pay
&lt;br&gt;&amp;gt;&amp;gt; attention to the UTF8 flag.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Obviously YAML::XS doesn't do that either.
&lt;/div&gt;&lt;br&gt;It does. It sets the flag to correctly reflect the state of the
&lt;br&gt;internal byte buffer of the scalar so that its string value will
&lt;br&gt;mean the right thing.
&lt;br&gt;&lt;br&gt;&amp;gt; But aside from that I agree with you, that something ist broken
&lt;br&gt;&amp;gt; in F(ast)CGI. It seems more that F(ast)CGI pays attention to
&lt;br&gt;&amp;gt; the utf8 flag where it shouldn't, because it seems to
&lt;br&gt;&amp;gt; automatically utf8::encode the buffer due to the set utf8 flag.
&lt;br&gt;&lt;br&gt;Ah, that may be, yeah, it would produce the result you are
&lt;br&gt;seeing, and would clearly be broken. C::E::FastCGI should just
&lt;br&gt;output the string as it is and let perl worry about its meaning,
&lt;br&gt;rather than (if that’s what it does) checking the UTF8 flag
&lt;br&gt;itself and doing something broken in response.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; No. YAML::XS is completely correct.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; No, it is not. Because it claims:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; This module exports the functions Dump and Load. These
&lt;br&gt;&amp;gt; &amp;nbsp; functions are intended to work exactly like YAML.pm's
&lt;br&gt;&amp;gt; &amp;nbsp; corresponding functions.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; And that's not the case. And therefore you can't use it as
&lt;br&gt;&amp;gt; a drop-in-replacement for other YAML modules.
&lt;/div&gt;&lt;br&gt;Hmm. I guess it depends on whether think of “drop-in” as
&lt;br&gt;something that replicates behaviour down to internal
&lt;br&gt;implementation details, or just functions identically on the
&lt;br&gt;semantic level. When I see a module advertise itself like that
&lt;br&gt;I assume only the latter.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;-- 
&lt;br&gt;Aristotle Pagaltzis // &amp;lt;&lt;a href=&quot;http://plasmasturm.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plasmasturm.org/&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486045&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unicode-trouble-with-Catalyst%3A%3AEngine%3A%3AFastCGI-tp26476878p26486045.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26485939</id>
	<title>Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T13:08:32Z</published>
	<updated>2009-11-23T13:08:32Z</updated>
	<author>
		<name>Aristotle Pagaltzis</name>
	</author>
	<content type="html">* Bill Moseley &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26485939&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;moseley@...&lt;/a&gt;&amp;gt; [2009-11-23 20:10]:
&lt;br&gt;&amp;gt; I'd argue that when it's time to set the length it should die
&lt;br&gt;&amp;gt; if utf8 flag is still set.
&lt;br&gt;&lt;br&gt;I’m of two minds about this… it may well be that a string is
&lt;br&gt;correctly encoded but has gotten upgraded, and such a string will
&lt;br&gt;produce the right output anyhow. I don’t know if it’s not too
&lt;br&gt;stringent to demand that the UTF8 flag be off.
&lt;br&gt;&lt;br&gt;However, the string should be *downgradeable* by that time. If
&lt;br&gt;there are wide characters in it at that time, then throwing an
&lt;br&gt;exception is absolutely the right thing to do. But if there
&lt;br&gt;aren’t, then you can’t decide based on the UTF8 flag whether the
&lt;br&gt;string is correct or not.
&lt;br&gt;&lt;br&gt;As I wrote, you can read a binary file, upgrade the string, and
&lt;br&gt;output it right back, and you’ll get an identical copy of the
&lt;br&gt;file out of that, because a string means one and the same thing
&lt;br&gt;regardless of whether it’s upgraded.
&lt;br&gt;&lt;br&gt;&amp;gt; When calculating the length the content should have already
&lt;br&gt;&amp;gt; been encoded.
&lt;br&gt;&lt;br&gt;Yes.
&lt;br&gt;&lt;br&gt;&amp;gt; Again, at some point decoding and encoding &amp;nbsp;should be core not
&lt;br&gt;&amp;gt; just a plugin. &amp;nbsp;It's an important part of the request cycle.
&lt;br&gt;&lt;br&gt;I agree.
&lt;br&gt;&lt;br&gt;Although it’s difficult to make it fully automatic because
&lt;br&gt;browsers suck so bad about telling you what encoding the data
&lt;br&gt;that they’re sending is in.
&lt;br&gt;&lt;br&gt;I am working on a plugin for that, but due to its dependencies
&lt;br&gt;and API I don’t know if it’d be reasonable to make it core.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;-- 
&lt;br&gt;Aristotle Pagaltzis // &amp;lt;&lt;a href=&quot;http://plasmasturm.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plasmasturm.org/&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26485939&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26485939.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26485760</id>
	<title>Re: How to reduce the memory footprint?</title>
	<published>2009-11-23T13:00:31Z</published>
	<updated>2009-11-23T13:00:31Z</updated>
	<author>
		<name>Tomas Doran</name>
	</author>
	<content type="html">&lt;br&gt;On 23 Nov 2009, at 18:18, Julien Sobrier wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; I have quite a small Catalyst application that runs with FastCGI + &amp;nbsp; 
&lt;br&gt;&amp;gt; FCGI::ProcManager::MaxRequests
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I run 5 instances of FastCGI. Each instance was taking about 90MB of &amp;nbsp;
&lt;br&gt;&amp;gt; memory. I tried to reduce the memory fooprint by reducing the number &amp;nbsp;
&lt;br&gt;&amp;gt; of libraries I used. The memory usage is now 120MB per instance! The &amp;nbsp;
&lt;br&gt;&amp;gt; memory increase is probably due to other changes.
&lt;br&gt;&lt;br&gt;When you say '5 instances', you mean you have nprocs = 5, right?
&lt;br&gt;&lt;br&gt;This _isn't_ using 100Mb per instance - all of the application is &amp;nbsp;
&lt;br&gt;loaded into memory before fork() is called, so it will mostly be &amp;nbsp;
&lt;br&gt;shared (by copy on write) memory.
&lt;br&gt;&lt;br&gt;Cheers
&lt;br&gt;t0m
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26485760&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-reduce-the-memory-footprint--tp26483372p26485760.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26484142</id>
	<title>Re: Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T11:08:04Z</published>
	<updated>2009-11-23T11:08:04Z</updated>
	<author>
		<name>Bill Moseley</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 23, 2009 at 10:14 AM, Aristotle Pagaltzis &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26484142&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;pagaltzis@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;br&gt;&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Encode the string to the destination encoding (not just character&lt;br&gt;
set), so that the string represents an encoded octet stream, and&lt;br&gt;
then look at the plain old character length of that string. That&lt;br&gt;
will always give you the right answer, regardless of whether that&lt;br&gt;
string is packed bytes or variable-width integers.&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;Correct.  And I&amp;#39;d argue that when it&amp;#39;s time to set the length it should die if utf8 flag is still set.&lt;br&gt;&lt;br&gt;When calculating the length the content should have already been encoded.&lt;br&gt;

&lt;br&gt;Again, at some point decoding and encoding  should be core not just a plugin.  It&amp;#39;s an important part of the request cycle.&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt; &lt;/div&gt;&lt;/div&gt;&lt;br&gt;-- &lt;br&gt;Bill Moseley&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26484142&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;moseley@...&lt;/a&gt;&lt;br&gt;


&lt;br /&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26484142&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26484142.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26483907</id>
	<title>Re: Re: Unicode trouble with Catalyst::Engine::FastCGI</title>
	<published>2009-11-23T10:53:52Z</published>
	<updated>2009-11-23T10:53:52Z</updated>
	<author>
		<name>Bernhard Graf-6</name>
	</author>
	<content type="html">Aristotle Pagaltzis schrieb:
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; While this fixes the problem, it is still unclear, why the utf8
&lt;br&gt;&amp;gt;&amp;gt; flag is set for the whole buffer.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It shouldn’t matter.
&lt;br&gt;&lt;br&gt;But it does.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; So Ladies and Gentleman, may I present you the culprit? It is
&lt;br&gt;&amp;gt;&amp;gt; YAML::XS! Everything read by YAML::XS
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; perl -MYAML::XS -E '
&lt;br&gt;&amp;gt;&amp;gt; my $config = YAML::XS::LoadFile(&amp;quot;myapp.yml&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt; say((utf8::is_utf8($config-&amp;gt;{name}) ? &amp;quot;is&amp;quot; : &amp;quot;is not&amp;quot;), &amp;quot; utf8&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt; '
&lt;br&gt;&amp;gt;&amp;gt; is utf8
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; No, that’s not the culprit.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The culprit is Catalyst::Engine::FastCGI, which does not pay
&lt;br&gt;&amp;gt; attention to the UTF8 flag.
&lt;/div&gt;&lt;br&gt;Obviously YAML::XS doesn't do that either.
&lt;br&gt;&lt;br&gt;But aside from that I agree with you, that something ist broken in
&lt;br&gt;F(ast)CGI. It seems more that F(ast)CGI pays attention to the utf8 flag
&lt;br&gt;where it shouldn't, because it seems to automatically utf8::encode the
&lt;br&gt;buffer due to the set utf8 flag.
&lt;br&gt;&lt;br&gt;&amp;gt; No. YAML::XS is completely correct.
&lt;br&gt;&lt;br&gt;No, it is not. Because it claims:
&lt;br&gt;&lt;br&gt;&amp;nbsp; This module exports the functions Dump and Load. These functions are
&lt;br&gt;&amp;nbsp; intended to work exactly like YAML.pm's corresponding functions.
&lt;br&gt;&lt;br&gt;And that's not the case. And therefore you can't use it as a
&lt;br&gt;drop-in-replacement for other YAML modules.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Bernhard Graf
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483907&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unicode-trouble-with-Catalyst%3A%3AEngine%3A%3AFastCGI-tp26476878p26483907.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26483509</id>
	<title>Re: Unicode trouble with Catalyst::Engine::FastCGI</title>
	<published>2009-11-23T10:25:00Z</published>
	<updated>2009-11-23T10:25:00Z</updated>
	<author>
		<name>Aristotle Pagaltzis</name>
	</author>
	<content type="html">* Bernhard Graf &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483509&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;catalyst4@...&lt;/a&gt;&amp;gt; [2009-11-23 19:10]:
&lt;br&gt;&amp;gt; Meanwhile I realized, that the final output buffer (header
&lt;br&gt;&amp;gt; + body) actually /has/ the UTF-8 flag set. So it seems, that
&lt;br&gt;&amp;gt; Jonathan's idea (above link) also matches my case. Everything
&lt;br&gt;&amp;gt; seems fine again, when I insert this line
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; utf8::downgrade($buffer) if utf8::is_utf8($buffer);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; into Catalyst::Engine::FastCGI::write() before
&lt;br&gt;&amp;gt; *STDOUT-&amp;gt;syswrite($buffer).
&lt;br&gt;&lt;br&gt;The conditional is superfluous. If you downgrade a string that
&lt;br&gt;doesn’t need downgrading, it’s a no-op.
&lt;br&gt;&lt;br&gt;&amp;gt; While this fixes the problem, it is still unclear, why the utf8
&lt;br&gt;&amp;gt; flag is set for the whole buffer.
&lt;br&gt;&lt;br&gt;It shouldn’t matter.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Since the body has already be turned into a clean octet-stream
&lt;br&gt;&amp;gt; by C:P:Unicode, the header must have been flagged as utf8 - and
&lt;br&gt;&amp;gt; this was actually the case. Digging further I found out, that
&lt;br&gt;&amp;gt; only the cookie string had the utf8 flag. The cookie is built
&lt;br&gt;&amp;gt; with CGI::Simple::Cookie from a hash, and in this hash only one
&lt;br&gt;&amp;gt; value had the utf8 flag: $cookie-&amp;gt;{domain}. And this comes from
&lt;br&gt;&amp;gt; myapp.yml, which is a YAML file, of course.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So Ladies and Gentleman, may I present you the culprit? It is
&lt;br&gt;&amp;gt; YAML::XS! Everything read by YAML::XS
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; perl -MYAML::XS -E '
&lt;br&gt;&amp;gt; my $config = YAML::XS::LoadFile(&amp;quot;myapp.yml&amp;quot;);
&lt;br&gt;&amp;gt; say((utf8::is_utf8($config-&amp;gt;{name}) ? &amp;quot;is&amp;quot; : &amp;quot;is not&amp;quot;), &amp;quot; utf8&amp;quot;);
&lt;br&gt;&amp;gt; '
&lt;br&gt;&amp;gt; is utf8
&lt;/div&gt;&lt;br&gt;No, that’s not the culprit.
&lt;br&gt;&lt;br&gt;The culprit is Catalyst::Engine::FastCGI, which does not pay
&lt;br&gt;attention to the UTF8 flag.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On the old installation YAML::XS was not installed. Actually
&lt;br&gt;&amp;gt; I installed that module right after I re-installed everything
&lt;br&gt;&amp;gt; from the snapshot.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; perl -MYAML::Syck -E '
&lt;br&gt;&amp;gt; my $config = YAML::Syck::LoadFile(&amp;quot;myapp.yml&amp;quot;);
&lt;br&gt;&amp;gt; say((utf8::is_utf8($config-&amp;gt;{name}) ? &amp;quot;is&amp;quot; : &amp;quot;is not&amp;quot;), &amp;quot; utf8&amp;quot;);
&lt;br&gt;&amp;gt; '
&lt;br&gt;&amp;gt; is not utf8
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So my first step is to kick YAML::XS. KICK, KICK, KICK!!!
&lt;br&gt;&amp;gt; Restart Cat-App - now it tells me:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; Use of YAML::Syck or YAML to parse config files is DEPRECATED. Please
&lt;br&gt;&amp;gt; &amp;nbsp; install YAML::XS for proper YAML support at
&lt;br&gt;&amp;gt; &amp;nbsp; /opt/perl/5.10.1/lib/site_perl/Config/Any.pm line 198
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But my output is fixed! WoohooOO!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So first of all YAML::XS must be fixed (I'll file a bug report now).
&lt;/div&gt;&lt;br&gt;No. YAML::XS is completely correct.
&lt;br&gt;&lt;br&gt;&amp;gt; Also Catalyst::Engine(::FastCGI) should assure, that this
&lt;br&gt;&amp;gt; implicit ut8::upgrade does not happen when the body has already
&lt;br&gt;&amp;gt; been encoded into an octet-stream.
&lt;br&gt;&lt;br&gt;Nope.
&lt;br&gt;&lt;br&gt;&amp;gt; But I'm not sure if utf8::downgrade() is the right approach to
&lt;br&gt;&amp;gt; fix this, because other Cat engines are not affected by this
&lt;br&gt;&amp;gt; utf8-flag bug, and those don't explicitly utf8::downgrade the
&lt;br&gt;&amp;gt; buffer either.
&lt;br&gt;&lt;br&gt;I’m not sure why ::FastCGI is affected specifically. Whether
&lt;br&gt;a string is upgraded or not should make no difference, though. In
&lt;br&gt;both cases the output should be the same. If it’s not, then
&lt;br&gt;something is broken in ::FastCGI.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;-- 
&lt;br&gt;Aristotle Pagaltzis // &amp;lt;&lt;a href=&quot;http://plasmasturm.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plasmasturm.org/&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483509&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unicode-trouble-with-Catalyst%3A%3AEngine%3A%3AFastCGI-tp26476878p26483509.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26487028</id>
	<title>Re: Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T10:24:17Z</published>
	<updated>2009-11-23T10:24:17Z</updated>
	<author>
		<name>Marc SCHAEFER</name>
	</author>
	<content type="html">On Mon, Nov 23, 2009 at 05:43:25PM +0100, Aristotle Pagaltzis wrote:
&lt;br&gt;&amp;gt; If you use the `html` filter instead of `html_entity`, it will
&lt;br&gt;&amp;gt; escape only the five characters that have to be.
&lt;br&gt;&lt;br&gt;Thank you. It works like a charm.
&lt;br&gt;&lt;br&gt;&amp;gt; I had an IRC convo with Tomas Doran last night and explained the
&lt;br&gt;&amp;gt; problem to him. He knocked out some tests for the broken
&lt;br&gt;&lt;br&gt;Thank you for your time! &amp;nbsp;It's nice to see the responsiveness of the
&lt;br&gt;project.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487028&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26487028.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26483372</id>
	<title>How to reduce the memory footprint?</title>
	<published>2009-11-23T10:18:50Z</published>
	<updated>2009-11-23T10:18:50Z</updated>
	<author>
		<name>Julien Sobrier</name>
	</author>
	<content type="html">Hello,&lt;br&gt;I have quite a small Catalyst application that runs with FastCGI +  FCGI::ProcManager::MaxRequests&lt;br&gt;&lt;br&gt;I run 5 instances of FastCGI. Each instance was taking about 90MB of memory. I tried to reduce the memory fooprint by reducing the number of libraries I used. The memory usage is now 120MB per instance! The memory increase is probably due to other changes.&lt;br&gt;
&lt;br&gt;I am wondering how to profile the memory usage, and how to reduce it:&lt;br&gt;* how can I figure out what is talking how much memory?&lt;br&gt;* is there a list of common things to do do to reduce the memory usage?&lt;br&gt;* is 100+MB per instance for  small application usual? I hope not...&lt;br&gt;
* any tip to reduce or profile my memory usage?&lt;br&gt;&lt;br&gt;Thank you&lt;br&gt;Julien&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483372&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-reduce-the-memory-footprint--tp26483372p26483372.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26483310</id>
	<title>Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T10:14:16Z</published>
	<updated>2009-11-23T10:14:16Z</updated>
	<author>
		<name>Aristotle Pagaltzis</name>
	</author>
	<content type="html">* Carl Johnstone &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483310&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;catalyst@...&lt;/a&gt;&amp;gt; [2009-11-23 18:50]:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Aristotle Pagaltzis wrote:
&lt;br&gt;&amp;gt; &amp;gt; Please plese don’t make statements like “not in this case”
&lt;br&gt;&amp;gt; &amp;gt; without knowing what the thing you are talking about does,
&lt;br&gt;&amp;gt; &amp;gt; i.e. in this case bytes::length, does. There are enough
&lt;br&gt;&amp;gt; &amp;gt; misconceptions about Unicode in Perl already.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; As far as the usage of bytes::length. Yes I agree with you that
&lt;br&gt;&amp;gt; the code is wrong as it's taking the byte length of perl's
&lt;br&gt;&amp;gt; internal representation - which happens to be utf-8 and whilst
&lt;br&gt;&amp;gt; correct in that case, isn't for any other character set and
&lt;br&gt;&amp;gt; shouldn't be relied upon.
&lt;/div&gt;&lt;br&gt;No: the internal representation can be either of two formats, and
&lt;br&gt;which of the two you get is not reliable, because it’s purely an
&lt;br&gt;implementation detail. It’s never correct. It just accidentally
&lt;br&gt;works much of the time, getting the right answer by using the
&lt;br&gt;wrong method.
&lt;br&gt;&lt;br&gt;&amp;gt; You *do* have to take a byte length of the string in the
&lt;br&gt;&amp;gt; destination character set though
&lt;br&gt;&lt;br&gt;Yes.
&lt;br&gt;&lt;br&gt;&amp;gt; so I'm interested in what the correct solution would be.
&lt;br&gt;&lt;br&gt;Encode the string to the destination encoding (not just character
&lt;br&gt;set), so that the string represents an encoded octet stream, and
&lt;br&gt;then look at the plain old character length of that string. That
&lt;br&gt;will always give you the right answer, regardless of whether that
&lt;br&gt;string is packed bytes or variable-width integers.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;-- 
&lt;br&gt;Aristotle Pagaltzis // &amp;lt;&lt;a href=&quot;http://plasmasturm.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plasmasturm.org/&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483310&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26483310.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26483202</id>
	<title>Re: Unicode trouble with Catalyst::Engine::FastCGI</title>
	<published>2009-11-23T10:06:58Z</published>
	<updated>2009-11-23T10:06:58Z</updated>
	<author>
		<name>Bernhard Graf-6</name>
	</author>
	<content type="html">Good news everyone!
&lt;br&gt;I found the gist of the matter and some places that should be fixed.
&lt;br&gt;&lt;br&gt;&amp;gt; Googling around I found
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg00051.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../msg00051.html&lt;/a&gt;&amp;nbsp;,
&lt;br&gt;&amp;gt; but I couldn't verify Jonathan's assumption in my case - even before the
&lt;br&gt;&amp;gt; buffer is written into the FastCGI pipe in
&lt;br&gt;&amp;gt; Catalyst::Engine::FastCGI::write the whole buffer (header and body)
&lt;br&gt;&amp;gt; looked fine right before calling STDOUT-&amp;gt;syswrite.
&lt;br&gt;&lt;br&gt;Meanwhile I realized, that the final output buffer (header + body)
&lt;br&gt;actually /has/ the UTF-8 flag set. So it seems, that Jonathan's idea
&lt;br&gt;(above link) also matches my case.
&lt;br&gt;Everything seems fine again, when I insert this line
&lt;br&gt;&lt;br&gt;&amp;nbsp; utf8::downgrade($buffer) if utf8::is_utf8($buffer);
&lt;br&gt;&lt;br&gt;into Catalyst::Engine::FastCGI::write() before
&lt;br&gt;*STDOUT-&amp;gt;syswrite($buffer).
&lt;br&gt;&lt;br&gt;While this fixes the problem, it is still unclear, why the utf8 flag is
&lt;br&gt;set for the whole buffer.
&lt;br&gt;&lt;br&gt;Since the body has already be turned into a clean octet-stream by
&lt;br&gt;C:P:Unicode, the header must have been flagged as utf8 - and this was
&lt;br&gt;actually the case. Digging further I found out, that only the cookie
&lt;br&gt;string had the utf8 flag. The cookie is built with CGI::Simple::Cookie
&lt;br&gt;from a hash, and in this hash only one value had the utf8 flag:
&lt;br&gt;$cookie-&amp;gt;{domain}. And this comes from myapp.yml, which is a YAML file,
&lt;br&gt;of course.
&lt;br&gt;&lt;br&gt;So Ladies and Gentleman, may I present you the culprit?
&lt;br&gt;It is YAML::XS! Everything read by YAML::XS
&lt;br&gt;&lt;br&gt;perl -MYAML::XS -E '
&lt;br&gt;my $config = YAML::XS::LoadFile(&amp;quot;myapp.yml&amp;quot;);
&lt;br&gt;say((utf8::is_utf8($config-&amp;gt;{name}) ? &amp;quot;is&amp;quot; : &amp;quot;is not&amp;quot;), &amp;quot; utf8&amp;quot;);
&lt;br&gt;'
&lt;br&gt;is utf8
&lt;br&gt;&lt;br&gt;On the old installation YAML::XS was not installed. Actually I installed
&lt;br&gt;that module right after I re-installed everything from the snapshot.
&lt;br&gt;&lt;br&gt;perl -MYAML::Syck -E '
&lt;br&gt;my $config = YAML::Syck::LoadFile(&amp;quot;myapp.yml&amp;quot;);
&lt;br&gt;say((utf8::is_utf8($config-&amp;gt;{name}) ? &amp;quot;is&amp;quot; : &amp;quot;is not&amp;quot;), &amp;quot; utf8&amp;quot;);
&lt;br&gt;'
&lt;br&gt;is not utf8
&lt;br&gt;&lt;br&gt;So my first step is to kick YAML::XS. KICK, KICK, KICK!!!
&lt;br&gt;Restart Cat-App - now it tells me:
&lt;br&gt;&lt;br&gt;&amp;nbsp; Use of YAML::Syck or YAML to parse config files is DEPRECATED. Please
&lt;br&gt;&amp;nbsp; install YAML::XS for proper YAML support at
&lt;br&gt;&amp;nbsp; /opt/perl/5.10.1/lib/site_perl/Config/Any.pm line 198
&lt;br&gt;&lt;br&gt;But my output is fixed! WoohooOO!
&lt;br&gt;&lt;br&gt;So first of all YAML::XS must be fixed (I'll file a bug report now).
&lt;br&gt;&lt;br&gt;Also Catalyst::Engine(::FastCGI) should assure, that this implicit
&lt;br&gt;ut8::upgrade does not happen when the body has already been encoded into
&lt;br&gt;an octet-stream. But I'm not sure if utf8::downgrade() is the right
&lt;br&gt;approach to fix this, because other Cat engines are not affected by this
&lt;br&gt;utf8-flag bug, and those don't explicitly utf8::downgrade the buffer either.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Bernhard Graf
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483202&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unicode-trouble-with-Catalyst%3A%3AEngine%3A%3AFastCGI-tp26476878p26483202.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26483003</id>
	<title>Re: Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T09:54:36Z</published>
	<updated>2009-11-23T09:54:36Z</updated>
	<author>
		<name>J. Shirley</name>
	</author>
	<content type="html">&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 23, 2009 at 8:34 AM, Aristotle Pagaltzis &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483003&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;pagaltzis@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;br&gt;[huge snip]&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Aristotle++&lt;br&gt;&lt;br&gt;This was a fantastic explanation with examples.  Even though I *think* I understand the unicode issues in perl, I still can find myself getting confused.  These examples just help that.&lt;br&gt;
&lt;br&gt;Thanks for this, it was really great.&lt;br&gt;&lt;br&gt;-J&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;J. Shirley :: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483003&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jshirley@...&lt;/a&gt; :: Killing two stones with one bird.&lt;br&gt;&lt;a href=&quot;http://our.coldhardcode.com/jshirley/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://our.coldhardcode.com/jshirley/&lt;/a&gt;&lt;br&gt;

&lt;br /&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26483003&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26483003.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26482815</id>
	<title>Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T09:42:13Z</published>
	<updated>2009-11-23T09:42:13Z</updated>
	<author>
		<name>Peter Edwards-7</name>
	</author>
	<content type="html">&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; &quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; &quot;&gt;
The fact is that counting bytes from the Perl Unicode upgraded string is&lt;br&gt;wrong when using ISO-8859-1.&lt;br&gt;&lt;br&gt;Maybe Catalyst dropped any support for non UTF-8 charset. By doing that&lt;br&gt;it also dropped any support for any charset having a bytesize different&lt;br&gt;
than the Perl Unicode upgraded string internal format, apparently.&lt;br&gt;&lt;br&gt;But I am no expert on this.&lt;br&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would recommend using utf-8 throughout, even if you think you&amp;#39;ll never need it.&lt;/div&gt;
&lt;div&gt;The reason is you can accidentally send what appear to be correct bytes even though they are not and if you are using a English browser you will never realise that pure chance is saving you.&lt;/div&gt;&lt;div&gt;You sail along sticking it in a database, in files, in templates and it works... until one day it doesn&amp;#39;t.&lt;/div&gt;
&lt;div&gt;Then you are in big trouble with data that might-be-latin-1 or might-be-utf-8 or might-be-double-encoded.&lt;/div&gt;&lt;div&gt;I watched a colleague spend 3 whole months fixing an internal framework like that. Proving his fixes worked was very difficult and the historic data in Oracle, well, there was no reliable way to unbork it.&lt;/div&gt;
&lt;div&gt;Many of us have been through a lifetime of pain with latin-1 encoding. Unless you are dead set on it, it&amp;#39;s much easier to use utf-8 throughout and add a few simple utf-8 unit tests at the input/output boundaries of your system components.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;It&amp;#39;s not so hard, add  use open &amp;#39;:utf8&amp;#39;;  to your code at the top or use binmode $fh, &amp;#39;:utf8&amp;#39;;  on open file handles. &lt;/div&gt;&lt;div&gt;Use the default utf-8 encoding in Template Toolkit. &lt;/div&gt;
&lt;div&gt;When you want to print a variable do   use Encode; print encode_utf8($foo);.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regards, Peter&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://perl.dragonstaff.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://perl.dragonstaff.co.uk&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/span&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26482815&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26482815.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26482831</id>
	<title>Re: Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T09:38:29Z</published>
	<updated>2009-11-23T09:38:29Z</updated>
	<author>
		<name>Carl Johnstone-4</name>
	</author>
	<content type="html">Aristotle Pagaltzis wrote:
&lt;br&gt;&amp;gt; But there’s no room for “likelies” here: that’s programming by
&lt;br&gt;&amp;gt; coincidence.
&lt;br&gt;&lt;br&gt;The &amp;quot;likely&amp;quot; was correct.
&lt;br&gt;&lt;br&gt;When using UTF-8 whether the length of the string is different in bytes and 
&lt;br&gt;characters depends entirely on what the contents of the string are. Given a 
&lt;br&gt;particular string I could tell you exactly whether they should match, but in 
&lt;br&gt;the general case all I can say is that it's *likely* to be different.
&lt;br&gt;&lt;br&gt;In any case that's an argument about English :-)
&lt;br&gt;&lt;br&gt;&amp;gt; Either you want it or you don’t, and in this case
&lt;br&gt;&amp;gt; you do. But bytes::length doesn’t do that.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Please plese don’t make statements like “not in this case”
&lt;br&gt;&amp;gt; without knowing what the thing you are talking about does, i.e.
&lt;br&gt;&amp;gt; in this case bytes::length, does. There are enough misconceptions
&lt;br&gt;&amp;gt; about Unicode in Perl already.
&lt;br&gt;&lt;br&gt;As far as the usage of bytes::length. Yes I agree with you that the code is 
&lt;br&gt;wrong as it's taking the byte length of perl's internal representation - 
&lt;br&gt;which happens to be utf-8 and whilst correct in that case, isn't for any 
&lt;br&gt;other character set and shouldn't be relied upon.
&lt;br&gt;&lt;br&gt;You *do* have to take a byte length of the string in the destination 
&lt;br&gt;character set though, so I'm interested in what the correct solution would 
&lt;br&gt;be.
&lt;br&gt;&lt;br&gt;Carl
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26482831&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26482831.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26481821</id>
	<title>Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T08:43:25Z</published>
	<updated>2009-11-23T08:43:25Z</updated>
	<author>
		<name>Aristotle Pagaltzis</name>
	</author>
	<content type="html">* Marc SCHAEFER &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481821&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;schaefer@...&lt;/a&gt;&amp;gt; [2009-11-23 17:20]:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, Nov 23, 2009 at 07:42:06AM -0800, Bill Moseley wrote:
&lt;br&gt;&amp;gt; &amp;gt;Still not following. &amp;nbsp; You are talking about Catalyst::View::TT?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It appears that the latin1 -&amp;gt; htmlentities conversion is done
&lt;br&gt;&amp;gt; by View:TT's htmlentity, e.g.:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;[% FOREACH h IN cols %]&amp;lt;td&amp;gt;[% b.$h | html_entity %]&amp;lt;/td&amp;gt;[% END %]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This is perfectly OK, even if not strictly required. I thought
&lt;br&gt;&amp;gt; it was something else doing that, but it isn't.
&lt;/div&gt;&lt;br&gt;If you use the `html` filter instead of `html_entity`, it will
&lt;br&gt;escape only the five characters that have to be.
&lt;br&gt;&lt;br&gt;&amp;gt; There is still apparently something wrong: there is absolutely
&lt;br&gt;&amp;gt; no reason why a Perl Unicode string should be used, but I was
&lt;br&gt;&amp;gt; unable to determine why it was created (upgraded) in the first
&lt;br&gt;&amp;gt; place.
&lt;br&gt;&lt;br&gt;There is no reason why such a string should NOT be used either.
&lt;br&gt;The meaning of the string doesn’t change. It’s an implementation
&lt;br&gt;detail in perl whether the string has been upgraded or not.
&lt;br&gt;&lt;br&gt;The bug is that bytes::length is being used to get its length.
&lt;br&gt;&lt;br&gt;&amp;gt; The fact is that counting bytes from the Perl Unicode upgraded
&lt;br&gt;&amp;gt; string is wrong when using ISO-8859-1.
&lt;br&gt;&lt;br&gt;Using bytes::length is ALWAYS wrong. No really, it’s ALWAYS
&lt;br&gt;wrong. (See the long rant in the other mail I just sent for an
&lt;br&gt;explanation.)
&lt;br&gt;&lt;br&gt;&amp;gt; Maybe Catalyst dropped any support for non UTF-8 charset. By
&lt;br&gt;&amp;gt; doing that it also dropped any support for any charset having
&lt;br&gt;&amp;gt; a bytesize different than the Perl Unicode upgraded string
&lt;br&gt;&amp;gt; internal format, apparently.
&lt;br&gt;&lt;br&gt;It’s just plain a bug in Catalyst that it’s using bytes::length.
&lt;br&gt;&lt;br&gt;I had an IRC convo with Tomas Doran last night and explained the
&lt;br&gt;problem to him. He knocked out some tests for the broken
&lt;br&gt;behaviour. It should be all fixed in the next release, and then
&lt;br&gt;you can upgrade and throw away that `before finalize_headers`
&lt;br&gt;workaround.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;-- 
&lt;br&gt;Aristotle Pagaltzis // &amp;lt;&lt;a href=&quot;http://plasmasturm.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plasmasturm.org/&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481821&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26481821.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26481572</id>
	<title>Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T08:34:20Z</published>
	<updated>2009-11-23T08:34:20Z</updated>
	<author>
		<name>Aristotle Pagaltzis</name>
	</author>
	<content type="html">* Carl Johnstone &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481572&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;catalyst@...&lt;/a&gt;&amp;gt; [2009-11-23 15:35]:
&lt;br&gt;&amp;gt; Aristotle Pagaltzis wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; # everything should be bytes at this point, but just in case
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; $response-&amp;gt;content_length( bytes::length( $response-&amp;gt;body ) );
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I was shocked to discover this! Any code that uses
&lt;br&gt;&amp;gt; &amp;gt; bytes::length is automatically broken.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Not in this case
&lt;br&gt;&lt;br&gt;Yes in this case.
&lt;br&gt;&lt;br&gt;&amp;gt; the HTTP spec says that the Content-Length header should
&lt;br&gt;&amp;gt; contain the number of octets in the body. If you're sending
&lt;br&gt;&amp;gt; UTF-8 then this is likely different to the number of characters
&lt;br&gt;&amp;gt; in the string.
&lt;br&gt;&lt;br&gt;You’re right about HTTP.
&lt;br&gt;&lt;br&gt;But there’s no room for “likelies” here: that’s programming by
&lt;br&gt;coincidence. Either you want it or you don’t, and in this case
&lt;br&gt;you do. But bytes::length doesn’t do that.
&lt;br&gt;&lt;br&gt;Please plese don’t make statements like “not in this case”
&lt;br&gt;without knowing what the thing you are talking about does, i.e.
&lt;br&gt;in this case bytes::length, does. There are enough misconceptions
&lt;br&gt;about Unicode in Perl already.
&lt;br&gt;&lt;br&gt;Try this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; use 5.010; require utf8; require bytes; require Data::Dump;
&lt;br&gt;&amp;nbsp; &amp;nbsp; $a = $b = chr(0xff);
&lt;br&gt;&amp;nbsp; &amp;nbsp; utf8::upgrade($a);
&lt;br&gt;&amp;nbsp; &amp;nbsp; utf8::downgrade($b);
&lt;br&gt;&amp;nbsp; &amp;nbsp; say Data::Dump::pp $a, $b;
&lt;br&gt;&amp;nbsp; &amp;nbsp; say $a eq $b ? 'ok' : 'not ok';
&lt;br&gt;&amp;nbsp; &amp;nbsp; say length($a) == length($b) ? 'ok' : 'not ok';
&lt;br&gt;&amp;nbsp; &amp;nbsp; say bytes::length($a) == bytes::length($b) ? 'ok' : 'not ok';
&lt;br&gt;&lt;br&gt;It will print the following:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; (&amp;quot;\xFF&amp;quot;, &amp;quot;\xFF&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; ok
&lt;br&gt;&amp;nbsp; &amp;nbsp; ok
&lt;br&gt;&amp;nbsp; &amp;nbsp; not ok
&lt;br&gt;&lt;br&gt;In other words, there are two entirely identical strings here,
&lt;br&gt;their internal buffers just happen to be in different formats:
&lt;br&gt;one is a packed byte array, the other is a variable-width integer
&lt;br&gt;arrays. And then bytes::length goes and *IGNORES* which is which,
&lt;br&gt;and just blithely looks at the size of the buffer without caring
&lt;br&gt;about the (ill-named) UTF8 flag – even though both strings, when
&lt;br&gt;printed, will produce the *exact same output*. Because they are
&lt;br&gt;IDENTICAL.
&lt;br&gt;&lt;br&gt;In Perl, there are ONLY strings. Semantically, there are no “byte
&lt;br&gt;strings and character strings”. Just strings. All strings are the
&lt;br&gt;same: character sequences, where a a character is an arbitrarily
&lt;br&gt;large integer value. That’s *all*.
&lt;br&gt;&lt;br&gt;Now there are, on the level of the perl implementation, two
&lt;br&gt;string formats: packed byte sequence strings (which are fast but
&lt;br&gt;can only store codepoints &amp;lt; 0x100) and variable-width integer
&lt;br&gt;sequence strings (which are slower but can store all codepoints).
&lt;br&gt;&lt;br&gt;However, from the Perl level, there is NO difference between
&lt;br&gt;those two kinds of string. If you have binary data in a string,
&lt;br&gt;then it’s simply a string that happens to consist of characters
&lt;br&gt;all &amp;lt; 0x100. Note how I didn’t talk about whether it’s a byte
&lt;br&gt;array string or a variable-width integer string? That’s because
&lt;br&gt;that doesn’t matter. Observe:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; my $jpeg = do {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; open my $fh, '&amp;lt;', 'some-image.jpeg' or die $!;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; local $/;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;$fh&amp;gt;;
&lt;br&gt;&amp;nbsp; &amp;nbsp; };
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; utf8::upgrade( $jpeg ); ### &amp;lt;------ note here
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; open my $fh, '&amp;gt;', 'output.jpeg' or die $!;
&lt;br&gt;&amp;nbsp; &amp;nbsp; print $fh $jpeg;
&lt;br&gt;&lt;br&gt;If you run this code, end result will be two EXACTLY IDENTICAL
&lt;br&gt;files. Because the contents in $jpeg mean the SAME THING after
&lt;br&gt;upgrading as they did before. You cannot tell from just looking
&lt;br&gt;at a string, whether it contains binary data or text.
&lt;br&gt;&lt;br&gt;However, if you ask for its bytes::length( $jpeg ), you’ll get
&lt;br&gt;the wrong number! Because bytes.pm is broken! As designed!
&lt;br&gt;&lt;br&gt;Note that up- or downgrading a string like this will happen at
&lt;br&gt;pretty random points in your code, and it won’t be obvious where
&lt;br&gt;or why. It’s not actually random of course, but the point where
&lt;br&gt;it happens might be hidden in some module several layers down
&lt;br&gt;your call stack. It might happen only some of the time. Which is
&lt;br&gt;perfectly fine, because the distinction between these two kinds
&lt;br&gt;of strings is an implementation detail in perl! Just like when
&lt;br&gt;you print numbers in Perl, and perl stringifies the scalar,
&lt;br&gt;caches the result of that conversion in the IV slot of the
&lt;br&gt;scalar, and never bothers to let you know.
&lt;br&gt;&lt;br&gt;Because you don’t need to know.
&lt;br&gt;&lt;br&gt;So it might happen that you properly Encode::encode’d your
&lt;br&gt;string, but it’s passed to some routine somewhere in the guts of
&lt;br&gt;some module you are using, which still causes it to get upgraded
&lt;br&gt;in the course some operation. And that’s just fine. It’s not
&lt;br&gt;a bug, just like it’s not a bug that perl silently stringifies
&lt;br&gt;numbers and silently numifies strings. The resulting output will
&lt;br&gt;always be correct in the end because every operation knows to pay
&lt;br&gt;attention to all the IOK, POK, etc flags in scalars that keep
&lt;br&gt;track of these conversions.
&lt;br&gt;&lt;br&gt;But bytes::length doesn’t! It breaks the fixed-/variable width
&lt;br&gt;abstraction by blithely ignoring the UTF8 flag. (Which should
&lt;br&gt;have been named UOK, to go with the IOK, POK, etc flags that
&lt;br&gt;scalars already have.) It’s as if, when you asked for the length
&lt;br&gt;of the number 65, and the scalar had never been stringified
&lt;br&gt;before, Perl didn’t bother to stringify it, and just looked at
&lt;br&gt;the length of the IV slot (integer value), and because you are
&lt;br&gt;running a 32-bit perl, the answer you got was 4. Whereas if you
&lt;br&gt;had stringified the scalar, then instead the answer would be
&lt;br&gt;2 because &amp;quot;65&amp;quot; is two characters long. And maybe your code is
&lt;br&gt;written such that it sometimes happens to stringify the scalar
&lt;br&gt;(eg. by printing it in a diagnostic message) and sometimes not.
&lt;br&gt;Then you get to play a lottery! Fun!
&lt;br&gt;&lt;br&gt;Conclusion of this much longer rant than I planned to write:
&lt;br&gt;&lt;br&gt;If you’re using bytes.pm or any of its functions, your code is
&lt;br&gt;BROKEN. Unconditionally.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;-- 
&lt;br&gt;Aristotle Pagaltzis // &amp;lt;&lt;a href=&quot;http://plasmasturm.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://plasmasturm.org/&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481572&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26481572.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26481255</id>
	<title>Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T08:18:02Z</published>
	<updated>2009-11-23T08:18:02Z</updated>
	<author>
		<name>Marc SCHAEFER</name>
	</author>
	<content type="html">On Mon, Nov 23, 2009 at 07:42:06AM -0800, Bill Moseley wrote:
&lt;br&gt;&amp;gt; Still not following. &amp;nbsp; You are talking about Catalyst::View::TT?
&lt;br&gt;&lt;br&gt;It appears that the latin1 -&amp;gt; htmlentities conversion is done by
&lt;br&gt;View:TT's htmlentity, e.g.:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; [% FOREACH h IN cols %]&amp;lt;td&amp;gt;[% b.$h | html_entity %]&amp;lt;/td&amp;gt;[% END %]
&lt;br&gt;&lt;br&gt;This is perfectly OK, even if not strictly required. &amp;nbsp;I thought it was
&lt;br&gt;something else doing that, but it isn't.
&lt;br&gt;&lt;br&gt;&amp;gt; BTW -- when looking at C::V::TT I see where you got that DEFAULT_ENCODING
&lt;br&gt;&amp;gt; from -- it's documented in C::V::TT.
&lt;br&gt;&lt;br&gt;The simple fact that html_entity above changes é (iso-8859-1) in &amp;eacute;
&lt;br&gt;means that something must have understood I am using iso-8859-1, which
&lt;br&gt;is good. But you seem to be right:
&lt;br&gt;&lt;br&gt;&amp;gt; As far as I know there's no such setting in Template Toolkit. &amp;nbsp;There's
&lt;br&gt;&amp;gt; &amp;quot;ENCODING&amp;quot; to specify the encoding of your templates.
&lt;br&gt;&lt;br&gt;I am using:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;package MyApp::View::TT;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;use strict;
&lt;br&gt;&amp;nbsp; &amp;nbsp;use base 'Catalyst::View::TT';
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;__PACKAGE__-&amp;gt;config(TEMPLATE_EXTENSION =&amp;gt; '.tt',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FILTERS =&amp;gt; { 'latex' =&amp;gt; \&amp;latex },
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DEFAULT_ENCODING &amp;nbsp; =&amp;gt; 'iso-8859-1',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WRAPPER =&amp;gt; 'wrapper.tt');
&lt;br&gt;&lt;br&gt;You are however right that removing the DEFAULT_ENCODING above
&lt;br&gt;doesn't change anything. Replacing it by ENCODING =&amp;gt; 'utf-8'
&lt;br&gt;creates a charset conversion bug (which is expected). Replacing with
&lt;br&gt;ENCODING =&amp;gt; 'iso-8859-1' doesn't change anything. So I can safely
&lt;br&gt;assume that as usually expected, iso-8859-1 is the default. &amp;nbsp;I now
&lt;br&gt;removed this specification altogether.
&lt;br&gt;&lt;br&gt;&amp;gt; If your templates are 8859-1 with 8 bit characters my suggestion would be to
&lt;br&gt;&amp;gt; convert them to utf-8 and set ENCODING to utf8 for the templates, and move
&lt;br&gt;&amp;gt; toward utf8 everywhere. &amp;nbsp; &amp;nbsp;Make sure you use the plugin to decode and
&lt;br&gt;&amp;gt; encode.
&lt;br&gt;&lt;br&gt;Again, utf8 is out of the question here: be it in the source file, the
&lt;br&gt;database, or the output. UTF-8 is unacceptable in our environment.
&lt;br&gt;&lt;br&gt;My problem (Catalyst sending iso-8859-1 data to the browser, but having
&lt;br&gt;a wrong Content-Length: as if counting the bytes from the UTF-8
&lt;br&gt;equivalent (or Perl Unicode upgraded string as mentionned in a separate
&lt;br&gt;mail by Aristotle Pagaltzis)) was solved by adding the following to MyApp.pm:
&lt;br&gt;&lt;br&gt;before 'finalize_headers'
&lt;br&gt;&amp;nbsp; &amp;nbsp;=&amp;gt; sub {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;my $c = shift;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($c-&amp;gt;response) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; my $s = $c-&amp;gt;response-&amp;gt;body;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; utf8::downgrade($s);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $c-&amp;gt;response-&amp;gt;body($s);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;There is still apparently something wrong: there is absolutely no reason
&lt;br&gt;why a Perl Unicode string should be used, but I was unable to determine
&lt;br&gt;why it was created (upgraded) in the first place.
&lt;br&gt;&lt;br&gt;The fact is that counting bytes from the Perl Unicode upgraded string is
&lt;br&gt;wrong when using ISO-8859-1.
&lt;br&gt;&lt;br&gt;Maybe Catalyst dropped any support for non UTF-8 charset. By doing that
&lt;br&gt;it also dropped any support for any charset having a bytesize different
&lt;br&gt;than the Perl Unicode upgraded string internal format, apparently.
&lt;br&gt;&lt;br&gt;But I am no expert on this.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481255&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26481255.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26480579</id>
	<title>Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T07:42:06Z</published>
	<updated>2009-11-23T07:42:06Z</updated>
	<author>
		<name>Bill Moseley</name>
	</author>
	<content type="html">&lt;br&gt;On Mon, Nov 23, 2009 at 2:01 AM, Marc SCHAEFER &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26480579&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;schaefer@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; On Sat, Nov 21, 2009 at 05:16:24PM -0800, Bill Moseley wrote:&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; Apparently all diacritic characters are expanded into HTML entities.&lt;br&gt;

&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; Where does that happen?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; It looks like it&amp;#39;s TT::View&amp;#39;s htmlentity which does this, not just for&lt;br&gt;&amp;gt; &amp;lt;&amp;gt; and friends.  It&amp;#39;s not a big issue for me. Maybe it could even be&lt;br&gt;

&amp;gt; parametered.&lt;br&gt;&amp;gt;&lt;br&gt;&lt;br&gt;Still not following.   You are talking about Catalyst::View::TT?&lt;br&gt;&lt;br&gt;&lt;br&gt;BTW -- when looking at C::V::TT I see where you got that DEFAULT_ENCODING from -- it&amp;#39;s documented in C::V::TT.&lt;br&gt;

&lt;br&gt;As far as I know there&amp;#39;s no such setting in Template Toolkit.  There&amp;#39;s &amp;quot;ENCODING&amp;quot; to specify the encoding of your templates.&lt;br&gt;&lt;br&gt;If your templates are 8859-1 with 8 bit characters my suggestion would be to convert them to utf-8 and set ENCODING to utf8 for the templates, and move toward utf8 everywhere.    Make sure you use the plugin to decode and encode.&lt;br&gt;

&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- &lt;br&gt;Bill Moseley&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26480579&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;moseley@...&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26480579&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26480579.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26479190</id>
	<title>Re: Re: Avoiding UTF8 in Catalyst</title>
	<published>2009-11-23T06:29:19Z</published>
	<updated>2009-11-23T06:29:19Z</updated>
	<author>
		<name>Carl Johnstone-4</name>
	</author>
	<content type="html">Aristotle Pagaltzis wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; # everything should be bytes at this point, but just in case
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; $response-&amp;gt;content_length( bytes::length( $response-&amp;gt;body ) );
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I was shocked to discover this! Any code that uses bytes::length
&lt;br&gt;&amp;gt; is automatically broken.
&lt;br&gt;&lt;br&gt;Not in this case, the HTTP spec says that the Content-Length header should 
&lt;br&gt;contain the number of octets in the body. If you're sending UTF-8 then this 
&lt;br&gt;is likely different to the number of characters in the string.
&lt;br&gt;&lt;br&gt;&amp;nbsp;Carl
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26479190&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Avoiding-UTF8-in-Catalyst-tp26460991p26479190.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26478247</id>
	<title>Re: consuming Webservices with Catalyst?</title>
	<published>2009-11-23T05:39:39Z</published>
	<updated>2009-11-23T05:39:39Z</updated>
	<author>
		<name>Joel Bernstein</name>
	</author>
	<content type="html">2009/11/23 Jens Schwarz &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26478247&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;blacky6767@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I want to change my Catalyst app so that its data is not written/read to/from my MySQL-DB but to/from Webservices.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have made a simple test (outside of Catalyst) with SOAP::WSDL that works for &amp;quot;reading&amp;quot; a Webservice. This looks like this:
&lt;br&gt;&amp;lt;snip&amp;gt;
&lt;br&gt;&amp;gt; But actually I have no clue on how to consume a Webservice &amp;quot;the Catalyst way&amp;quot;. The amount of CPAN modules covering SOAP, WSDL, ... is overwhelming and I am kind of lost.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Are there any remommendations - especially with detailed examples? It was hard for me to even get this simple example above working as I am SOAP/WSDL newbie.
&lt;br&gt;&lt;br&gt;I think you have the right idea. Build a standalone web-service
&lt;br&gt;client. In your example you're using a SOAP service, so I would use
&lt;br&gt;XML::Compile::SOAP and XML::Compile::WSDL11, but you might have good
&lt;br&gt;luck with the SOAP::* modules, I am less familiar with those. Either
&lt;br&gt;way, build a standalone client which you can test on its own. Finally
&lt;br&gt;build a thin Catalyst-aware shim, using Catalyst::Model::Adaptor or
&lt;br&gt;Catalyst::Component::InstancePerContext, which wraps/consumes your
&lt;br&gt;standalone model and captures whatever Catalyst config etc you need to
&lt;br&gt;use your model within Catalyst. This approach may require slightly
&lt;br&gt;more code files than the monolithic approach but will be much simpler
&lt;br&gt;to test since you remove the Catalyst dependency from verifying the
&lt;br&gt;majority of your model's behaviour.
&lt;br&gt;&lt;br&gt;/joel
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26478247&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/consuming-Webservices-with-Catalyst--tp26478109p26478247.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26478109</id>
	<title>consuming Webservices with Catalyst?</title>
	<published>2009-11-23T05:27:52Z</published>
	<updated>2009-11-23T05:27:52Z</updated>
	<author>
		<name>Jens Schwarz</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I want to change my Catalyst app so that its data is not written/read to/from my MySQL-DB but to/from Webservices.
&lt;br&gt;&lt;br&gt;I have made a simple test (outside of Catalyst) with SOAP::WSDL that works for &amp;quot;reading&amp;quot; a Webservice. This looks like this:
&lt;br&gt;&lt;br&gt;use MyInterfaces::FooService::FooPortType;
&lt;br&gt;&lt;br&gt;my $user = 'someuser';
&lt;br&gt;my $pass = 'somepass';
&lt;br&gt;&lt;br&gt;*SOAP::Transport::HTTP::Client::get_basic_credentials = sub {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ($user, $pass);
&lt;br&gt;};
&lt;br&gt;&lt;br&gt;my $s = MyInterfaces::FooService::FooPortType-&amp;gt;new();
&lt;br&gt;my $r = $s-&amp;gt;Foo( {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Parameter1' =&amp;gt; 'bar',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Parameter2' =&amp;gt; 'baz',
&lt;br&gt;} );
&lt;br&gt;print $r;
&lt;br&gt;&lt;br&gt;But actually I have no clue on how to consume a Webservice &amp;quot;the Catalyst way&amp;quot;. The amount of CPAN modules covering SOAP, WSDL, ... is overwhelming and I am kind of lost.
&lt;br&gt;&lt;br&gt;Are there any remommendations - especially with detailed examples? It was hard for me to even get this simple example above working as I am SOAP/WSDL newbie.
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;Jens
&lt;br&gt;-- 
&lt;br&gt;Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
&lt;br&gt;sicherer, schneller und einfacher! &lt;a href=&quot;http://portal.gmx.net/de/go/chbrowser&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://portal.gmx.net/de/go/chbrowser&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26478109&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/consuming-Webservices-with-Catalyst--tp26478109p26478109.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26476878</id>
	<title>Unicode trouble with Catalyst::Engine::FastCGI</title>
	<published>2009-11-23T03:57:27Z</published>
	<updated>2009-11-23T03:57:27Z</updated>
	<author>
		<name>Bernhard Graf-6</name>
	</author>
	<content type="html">After I recently re-installed my Development-Perl (that one, that I use
&lt;br&gt;apart from the production Perl installation), all pages that went
&lt;br&gt;through Catalyst::Engine::FastCGI got double-utf8-encoded.
&lt;br&gt;&lt;br&gt;When using the standalone HTTP server, everything is fine.
&lt;br&gt;&lt;br&gt;Both installations used Perl 5.10.1. I did a snapshot of the old modules
&lt;br&gt;at first and then re-installed everything on the new installation.
&lt;br&gt;&lt;br&gt;Googling around I found
&lt;br&gt;&lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg00051.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../msg00051.html&lt;/a&gt;&amp;nbsp;,
&lt;br&gt;but I couldn't verify Jonathan's assumption in my case - even before the
&lt;br&gt;buffer is written into the FastCGI pipe in
&lt;br&gt;Catalyst::Engine::FastCGI::write the whole buffer (header and body)
&lt;br&gt;looked fine right before calling STDOUT-&amp;gt;syswrite.
&lt;br&gt;&lt;br&gt;Is there anyone here, who has experienced similar effects and maybe
&lt;br&gt;found a solution (besides kicking out the FastCGI engine)?
&lt;br&gt;&lt;br&gt;Meanwhile I'm proxying from the main webserver to C:E:HTTP::Prefork,
&lt;br&gt;which works fine, but I would prefer keeping FastCGI as an alternative.
&lt;br&gt;&lt;br&gt;Bernhard Graf
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26476878&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Unicode-trouble-with-Catalyst%3A%3AEngine%3A%3AFastCGI-tp26476878p26476878.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26475403</id>
	<title>Re: call of the dbd disconnect method via catalyst model</title>
	<published>2009-11-23T02:12:42Z</published>
	<updated>2009-11-23T02:12:42Z</updated>
	<author>
		<name>Tomas Doran</name>
	</author>
	<content type="html">&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26475403&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;christian4catalyst@...&lt;/a&gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Can me someone say, where i can, who i can close the dbd-connection in line 
&lt;br&gt;&amp;gt; 09, so that line 10 reopen the connection.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 01 sub	foo
&lt;br&gt;&amp;gt; 02 {
&lt;br&gt;&amp;gt; 03 &amp;nbsp; my		( $self, $c )	= @_;
&lt;br&gt;&amp;gt; 04 &amp;nbsp; my		$model		= $c-&amp;gt;model('DB::TABLE') ;
&lt;br&gt;&amp;gt; 05 &amp;nbsp; my		$row ;
&lt;br&gt;&amp;gt; 06 &amp;nbsp; my		$res ;
&lt;br&gt;&amp;gt; 07
&lt;br&gt;&amp;gt; 08 &amp;nbsp; $row	= { ... } ;
&lt;br&gt;&amp;gt; 09 &amp;nbsp; ##	$model-&amp;gt; 	method to call for dbd-&amp;gt;disconnect()
&lt;br&gt;&amp;gt; 10 &amp;nbsp; $res	= [$model-&amp;gt;search($row)] ;
&lt;br&gt;&amp;gt; 11
&lt;br&gt;&amp;gt; 12 &amp;nbsp;...
&lt;br&gt;&amp;gt; 13 }
&lt;/div&gt;&lt;br&gt;Erm, this is a DBIx::Class question isn't it? (At a guess - you haven't 
&lt;br&gt;told us in any way what code you're using to provide your DB model, so 
&lt;br&gt;I'm just wildly speculating here).
&lt;br&gt;&lt;br&gt;You want to do something like $c-&amp;gt;model('DB')-&amp;gt;schema to get the 
&lt;br&gt;DBIx::Class::Schema, then call -&amp;gt;disconnect on that, or possibly 
&lt;br&gt;-&amp;gt;schema-&amp;gt;dbh-&amp;gt;disconnect.
&lt;br&gt;&lt;br&gt;Cheers
&lt;br&gt;t0m
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;List: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26475403&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Catalyst@...&lt;/a&gt;
&lt;br&gt;Listinfo: &lt;a href=&quot;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst&lt;/a&gt;&lt;br&gt;Searchable archive: &lt;a href=&quot;http://www.mail-archive.com/catalyst@lists.scsys.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/catalyst@.../&lt;/a&gt;&lt;br&gt;Dev site: &lt;a href=&quot;http://dev.catalyst.perl.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://dev.catalyst.perl.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/call-of-the-dbd-disconnect-method-via-catalyst-model-tp26471771p26475403.html" />
</entry>

</feed>
