<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Perl &#187; www</title>
	<atom:link href="http://perl.baczynski.com/tag/www/feed" rel="self" type="application/rss+xml" />
	<link>http://perl.baczynski.com</link>
	<description>Perl, CPAN, YAPC... et ceatera</description>
	<lastBuildDate>Sat, 14 Aug 2010 17:20:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=7742</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Masons and mason</title>
		<link>http://perl.baczynski.com/work/masons-and-mason</link>
		<comments>http://perl.baczynski.com/work/masons-and-mason#comments</comments>
		<pubDate>Wed, 31 Mar 2010 04:57:59 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[perlisnotdead]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=272</guid>
		<description><![CDATA[


I&#8217;m reading now a book by Dan Brown, author of &#8220;DaVinci code&#8221;, titled &#8220;Lost symbol&#8221;. It is mostly about masons. And it quite resemble the previous books by this author. Anyway, it is riveting.
This seemingly off-topic introduction leads to the on-topic perl thing: the mason. It is a &#8220;High-performance, dynamic web site authoring system&#8221; and [...]


See also:<ol><li><a href='http://perl.baczynski.com/work/website-login-with-perl' rel='bookmark' title='Permanent Link: Website login with Perl'>Website login with Perl</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m reading now a book by Dan Brown, author of &#8220;DaVinci code&#8221;, titled &#8220;Lost symbol&#8221;. It is mostly about masons. And it quite resemble the previous books by this author. Anyway, it is riveting.</p>
<p>This seemingly off-topic introduction leads to the on-topic perl thing:<a title="mason hq" href="http://www.masonhq.com/" target="_blank"> the mason</a>. It is a &#8220;High-performance, dynamic web site authoring system&#8221; and &#8220;solves the common problems of site development: caching, debugging, templating, maintaining development and production sites, and more.&#8221; and &#8220;you can embed Perl code in your HTML and construct pages from shared, reusable components.&#8221;. Well, sound nice. How it looks? Like this:</p>
<p>(there was something wrong here. I removed it <img src='http://perl.baczynski.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )<br />
<!--</p>
<pre>[% page_title = "List all books" %]
[% INCLUDE header.tt %]

&lt;ul&gt;
[% FOREACH book = books %]
&lt;li&gt;[% book.title %] ([% book.author.name %])
[% FOREACH review = book.reviews %]
(&lt;a href=&#8221;review.cgi?review=[% review.uid %]&#8220;&gt;Read review
by [% review.reviewer.name %]&lt;/a&gt;)
[% END %]
&lt;/li&gt;
[% END %]
&lt;/ul&gt;

[% INCLUDE footer.tt %]
</pre>
<p>Source: <a href="http://www.perl.com/pub/a/2003/07/15/nocode.html">http://www.perl.com/pub/a/2003/07/15/nocode.html</a>. Not so pretty.<br />
--></p>
<p>Sadly, the FAQ on the official page seems to be neglected and is spammed by merchants of medications made to make your weenie harder. On the other hand, newest version is 1.44 form Jan 4, 2010 - so it is still developed.</p>
<p>Assuming that I would like to learn something new, like "something big, modern, to easy make web applications - with templates, cache, scalability, quick development" should I dive into mason, or better look for something else?</p>
<p>So, I have question, asking <strong>YOU</strong> for an insight about this<em> like:</em><br />
- <em>mason</em> is cool, and at least better to do the same by your own from scratch<br />
- forget it, it is so 1990's, learn <em>catalyst</em> instead<br />
- forget mason and catalyst, learn PHP <em>symphony</em> (- no problem for me, I know PHP - more or less <img src='http://perl.baczynski.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )<br />
- ruby <em>on rails</em> is the real thing (no, I will not learn ruby - at least now <img src='http://perl.baczynski.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )<br />
- the best is framework .... (something not mentioned above)</p>
<p>Please write your opinion below. Thank you.</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;title=Masons%20and%20mason&amp;bodytext=I%27m%20reading%20now%20a%20book%20by%20Dan%20Brown%2C%20author%20of%20%22DaVinci%20code%22%2C%20titled%20%22Lost%20symbol%22.%20It%20is%20mostly%20about%20masons.%20And%20it%20quite%20resemble%20the%20previous%20books%20by%20this%20author.%20Anyway%2C%20it%20is%20riveting.%0D%0A%0D%0AThis%20seemingly%20off-topic%20introduction%20leads%20to%20the%20on-" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;title=Masons%20and%20mason&amp;notes=I%27m%20reading%20now%20a%20book%20by%20Dan%20Brown%2C%20author%20of%20%22DaVinci%20code%22%2C%20titled%20%22Lost%20symbol%22.%20It%20is%20mostly%20about%20masons.%20And%20it%20quite%20resemble%20the%20previous%20books%20by%20this%20author.%20Anyway%2C%20it%20is%20riveting.%0D%0A%0D%0AThis%20seemingly%20off-topic%20introduction%20leads%20to%20the%20on-" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;t=Masons%20and%20mason" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;title=Masons%20and%20mason" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;title=Masons%20and%20mason&amp;annotation=I%27m%20reading%20now%20a%20book%20by%20Dan%20Brown%2C%20author%20of%20%22DaVinci%20code%22%2C%20titled%20%22Lost%20symbol%22.%20It%20is%20mostly%20about%20masons.%20And%20it%20quite%20resemble%20the%20previous%20books%20by%20this%20author.%20Anyway%2C%20it%20is%20riveting.%0D%0A%0D%0AThis%20seemingly%20off-topic%20introduction%20leads%20to%20the%20on-" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Masons%20and%20mason&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;title=Masons%20and%20mason&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=I%27m%20reading%20now%20a%20book%20by%20Dan%20Brown%2C%20author%20of%20%22DaVinci%20code%22%2C%20titled%20%22Lost%20symbol%22.%20It%20is%20mostly%20about%20masons.%20And%20it%20quite%20resemble%20the%20previous%20books%20by%20this%20author.%20Anyway%2C%20it%20is%20riveting.%0D%0A%0D%0AThis%20seemingly%20off-topic%20introduction%20leads%20to%20the%20on-" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;t=Masons%20and%20mason" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;title=Masons%20and%20mason" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Masons%20and%20mason&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;title=Masons%20and%20mason" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason%20Masons%20and%20mason" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Masons%20and%20mason%20-%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;t=Masons%20and%20mason&opener=bm&amp;ei=UTF-8&amp;d=I%27m%20reading%20now%20a%20book%20by%20Dan%20Brown%2C%20author%20of%20%22DaVinci%20code%22%2C%20titled%20%22Lost%20symbol%22.%20It%20is%20mostly%20about%20masons.%20And%20it%20quite%20resemble%20the%20previous%20books%20by%20this%20author.%20Anyway%2C%20it%20is%20riveting.%0D%0A%0D%0AThis%20seemingly%20off-topic%20introduction%20leads%20to%20the%20on-" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fmasons-and-mason&amp;submitHeadline=Masons%20and%20mason&amp;submitSummary=I%27m%20reading%20now%20a%20book%20by%20Dan%20Brown%2C%20author%20of%20%22DaVinci%20code%22%2C%20titled%20%22Lost%20symbol%22.%20It%20is%20mostly%20about%20masons.%20And%20it%20quite%20resemble%20the%20previous%20books%20by%20this%20author.%20Anyway%2C%20it%20is%20riveting.%0D%0A%0D%0AThis%20seemingly%20off-topic%20introduction%20leads%20to%20the%20on-&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/work/website-login-with-perl' rel='bookmark' title='Permanent Link: Website login with Perl'>Website login with Perl</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/work/masons-and-mason/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Unicode horror &#8211; nice tool to convert</title>
		<link>http://perl.baczynski.com/work/unicode-tool-convert</link>
		<comments>http://perl.baczynski.com/work/unicode-tool-convert#comments</comments>
		<pubDate>Wed, 13 Jan 2010 04:59:26 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=199</guid>
		<description><![CDATA[Here is a nice tool to convert for example different characters to percent encoding for URIs, 0x notation, decimal code points etc; (by Richard Ishida):
http://rishida.net/tools/conversion/
Ok, it is not strictly related to perl , but I guess it may be handy for people that were interested in the &#8220;utf at LAMP horror&#8221; cycle.



Share and Enjoy:


	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	




See also:Utf8 [...]


See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-horror-at-lamp-part-5' rel='bookmark' title='Permanent Link: Utf8 horror at LAMP &#8211; accept charset'>Utf8 horror at LAMP &#8211; accept charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-lamp-encod' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode'>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here is a nice tool to convert for example different characters to percent encoding for URIs, 0x notation, decimal code points etc; (by Richard Ishida):</p>
<p><a href="http://rishida.net/tools/conversion/">http://rishida.net/tools/conversion/</a></p>
<p>Ok, it is not strictly related to perl , but I guess it may be handy for people that were interested in the &#8220;utf at LAMP horror&#8221; cycle.</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;title=Unicode%20horror%20-%20nice%20tool%20to%20convert&amp;bodytext=Here%20is%20a%20nice%20tool%20to%20convert%20for%20example%20different%20characters%20to%20percent%20encoding%20for%20URIs%2C%200x%20notation%2C%20decimal%20code%20points%20etc%3B%20%28by%20Richard%20Ishida%29%3A%0D%0A%0D%0Ahttp%3A%2F%2Frishida.net%2Ftools%2Fconversion%2F%0D%0A%0D%0AOk%2C%20it%20is%20not%20strictly%20related%20to%20perl%20%2C%20but%20I%20guess%20i" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;title=Unicode%20horror%20-%20nice%20tool%20to%20convert&amp;notes=Here%20is%20a%20nice%20tool%20to%20convert%20for%20example%20different%20characters%20to%20percent%20encoding%20for%20URIs%2C%200x%20notation%2C%20decimal%20code%20points%20etc%3B%20%28by%20Richard%20Ishida%29%3A%0D%0A%0D%0Ahttp%3A%2F%2Frishida.net%2Ftools%2Fconversion%2F%0D%0A%0D%0AOk%2C%20it%20is%20not%20strictly%20related%20to%20perl%20%2C%20but%20I%20guess%20i" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;t=Unicode%20horror%20-%20nice%20tool%20to%20convert" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;title=Unicode%20horror%20-%20nice%20tool%20to%20convert" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;title=Unicode%20horror%20-%20nice%20tool%20to%20convert&amp;annotation=Here%20is%20a%20nice%20tool%20to%20convert%20for%20example%20different%20characters%20to%20percent%20encoding%20for%20URIs%2C%200x%20notation%2C%20decimal%20code%20points%20etc%3B%20%28by%20Richard%20Ishida%29%3A%0D%0A%0D%0Ahttp%3A%2F%2Frishida.net%2Ftools%2Fconversion%2F%0D%0A%0D%0AOk%2C%20it%20is%20not%20strictly%20related%20to%20perl%20%2C%20but%20I%20guess%20i" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Unicode%20horror%20-%20nice%20tool%20to%20convert&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;title=Unicode%20horror%20-%20nice%20tool%20to%20convert&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=Here%20is%20a%20nice%20tool%20to%20convert%20for%20example%20different%20characters%20to%20percent%20encoding%20for%20URIs%2C%200x%20notation%2C%20decimal%20code%20points%20etc%3B%20%28by%20Richard%20Ishida%29%3A%0D%0A%0D%0Ahttp%3A%2F%2Frishida.net%2Ftools%2Fconversion%2F%0D%0A%0D%0AOk%2C%20it%20is%20not%20strictly%20related%20to%20perl%20%2C%20but%20I%20guess%20i" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;t=Unicode%20horror%20-%20nice%20tool%20to%20convert" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;title=Unicode%20horror%20-%20nice%20tool%20to%20convert" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Unicode%20horror%20-%20nice%20tool%20to%20convert&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;title=Unicode%20horror%20-%20nice%20tool%20to%20convert" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert%20Unicode%20horror%20-%20nice%20tool%20to%20convert" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Unicode%20horror%20-%20nice%20tool%20to%20convert%20-%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;t=Unicode%20horror%20-%20nice%20tool%20to%20convert&opener=bm&amp;ei=UTF-8&amp;d=Here%20is%20a%20nice%20tool%20to%20convert%20for%20example%20different%20characters%20to%20percent%20encoding%20for%20URIs%2C%200x%20notation%2C%20decimal%20code%20points%20etc%3B%20%28by%20Richard%20Ishida%29%3A%0D%0A%0D%0Ahttp%3A%2F%2Frishida.net%2Ftools%2Fconversion%2F%0D%0A%0D%0AOk%2C%20it%20is%20not%20strictly%20related%20to%20perl%20%2C%20but%20I%20guess%20i" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Funicode-tool-convert&amp;submitHeadline=Unicode%20horror%20-%20nice%20tool%20to%20convert&amp;submitSummary=Here%20is%20a%20nice%20tool%20to%20convert%20for%20example%20different%20characters%20to%20percent%20encoding%20for%20URIs%2C%200x%20notation%2C%20decimal%20code%20points%20etc%3B%20%28by%20Richard%20Ishida%29%3A%0D%0A%0D%0Ahttp%3A%2F%2Frishida.net%2Ftools%2Fconversion%2F%0D%0A%0D%0AOk%2C%20it%20is%20not%20strictly%20related%20to%20perl%20%2C%20but%20I%20guess%20i&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-horror-at-lamp-part-5' rel='bookmark' title='Permanent Link: Utf8 horror at LAMP &#8211; accept charset'>Utf8 horror at LAMP &#8211; accept charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-lamp-encod' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode'>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/work/unicode-tool-convert/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utf8 horror at LAMP &#8211; accept charset</title>
		<link>http://perl.baczynski.com/work/utf8-horror-at-lamp-part-5</link>
		<comments>http://perl.baczynski.com/work/utf8-horror-at-lamp-part-5#comments</comments>
		<pubDate>Wed, 30 Dec 2009 04:55:38 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=168</guid>
		<description><![CDATA[Continuing the never ending saga of perl / utf horror:
&#60;form method=&#8221;post&#8221; accept-charset=&#8221;utf-8&#8243; action=&#8221;&#8230;&#8221;&#62;
Well, I never used it&#8230; and my web app works.
Is this accept-charset really needed? Do you know?



Share and Enjoy:


	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	




See also:Utf8 in web perl application (LAMP) &#8211; binmode, charset
Utf8 in web perl application (LAMP) &#8211; dbi, mysql
Utf8 in web perl application (LAMP)



See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-perl-application-charse' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; binmode, charset'>Utf8 in web perl application (LAMP) &#8211; binmode, charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Continuing the never ending saga of perl / utf horror:</p>
<blockquote><p>&lt;form method=&#8221;post&#8221; accept-charset=&#8221;utf-8&#8243; action=&#8221;&#8230;&#8221;&gt;</p></blockquote>
<p>Well, I never used it&#8230; and my web app works.</p>
<p>Is this accept-charset really needed? Do you know?</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;title=Utf8%20horror%20at%20LAMP%20-%20accept%20charset&amp;bodytext=Continuing%20the%20never%20ending%20saga%20of%20perl%20%2F%20utf%20horror%3A%0D%0A%26lt%3Bform%20method%3D%22post%22%20accept-charset%3D%22utf-8%22%20action%3D%22...%22%26gt%3B%0D%0AWell%2C%20I%20never%20used%20it...%20and%20my%20web%20app%20works.%0D%0A%0D%0AIs%20this%20accept-charset%20really%20needed%3F%20Do%20you%20know%3F" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;title=Utf8%20horror%20at%20LAMP%20-%20accept%20charset&amp;notes=Continuing%20the%20never%20ending%20saga%20of%20perl%20%2F%20utf%20horror%3A%0D%0A%26lt%3Bform%20method%3D%22post%22%20accept-charset%3D%22utf-8%22%20action%3D%22...%22%26gt%3B%0D%0AWell%2C%20I%20never%20used%20it...%20and%20my%20web%20app%20works.%0D%0A%0D%0AIs%20this%20accept-charset%20really%20needed%3F%20Do%20you%20know%3F" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;t=Utf8%20horror%20at%20LAMP%20-%20accept%20charset" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;title=Utf8%20horror%20at%20LAMP%20-%20accept%20charset" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;title=Utf8%20horror%20at%20LAMP%20-%20accept%20charset&amp;annotation=Continuing%20the%20never%20ending%20saga%20of%20perl%20%2F%20utf%20horror%3A%0D%0A%26lt%3Bform%20method%3D%22post%22%20accept-charset%3D%22utf-8%22%20action%3D%22...%22%26gt%3B%0D%0AWell%2C%20I%20never%20used%20it...%20and%20my%20web%20app%20works.%0D%0A%0D%0AIs%20this%20accept-charset%20really%20needed%3F%20Do%20you%20know%3F" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Utf8%20horror%20at%20LAMP%20-%20accept%20charset&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;title=Utf8%20horror%20at%20LAMP%20-%20accept%20charset&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=Continuing%20the%20never%20ending%20saga%20of%20perl%20%2F%20utf%20horror%3A%0D%0A%26lt%3Bform%20method%3D%22post%22%20accept-charset%3D%22utf-8%22%20action%3D%22...%22%26gt%3B%0D%0AWell%2C%20I%20never%20used%20it...%20and%20my%20web%20app%20works.%0D%0A%0D%0AIs%20this%20accept-charset%20really%20needed%3F%20Do%20you%20know%3F" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;t=Utf8%20horror%20at%20LAMP%20-%20accept%20charset" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;title=Utf8%20horror%20at%20LAMP%20-%20accept%20charset" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Utf8%20horror%20at%20LAMP%20-%20accept%20charset&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;title=Utf8%20horror%20at%20LAMP%20-%20accept%20charset" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5%20Utf8%20horror%20at%20LAMP%20-%20accept%20charset" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Utf8%20horror%20at%20LAMP%20-%20accept%20charset%20-%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;t=Utf8%20horror%20at%20LAMP%20-%20accept%20charset&opener=bm&amp;ei=UTF-8&amp;d=Continuing%20the%20never%20ending%20saga%20of%20perl%20%2F%20utf%20horror%3A%0D%0A%26lt%3Bform%20method%3D%22post%22%20accept-charset%3D%22utf-8%22%20action%3D%22...%22%26gt%3B%0D%0AWell%2C%20I%20never%20used%20it...%20and%20my%20web%20app%20works.%0D%0A%0D%0AIs%20this%20accept-charset%20really%20needed%3F%20Do%20you%20know%3F" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-horror-at-lamp-part-5&amp;submitHeadline=Utf8%20horror%20at%20LAMP%20-%20accept%20charset&amp;submitSummary=Continuing%20the%20never%20ending%20saga%20of%20perl%20%2F%20utf%20horror%3A%0D%0A%26lt%3Bform%20method%3D%22post%22%20accept-charset%3D%22utf-8%22%20action%3D%22...%22%26gt%3B%0D%0AWell%2C%20I%20never%20used%20it...%20and%20my%20web%20app%20works.%0D%0A%0D%0AIs%20this%20accept-charset%20really%20needed%3F%20Do%20you%20know%3F&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-perl-application-charse' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; binmode, charset'>Utf8 in web perl application (LAMP) &#8211; binmode, charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/work/utf8-horror-at-lamp-part-5/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</title>
		<link>http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi</link>
		<comments>http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi#comments</comments>
		<pubDate>Wed, 23 Dec 2009 04:59:16 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=163</guid>
		<description><![CDATA[Horror with utf8 and LAMP ( perl ) web application contiunued:
We need to take care of  mysql connection, so it is ut8 &#8211; ready:
if (my $dbh = DBI-&#62;connect(&#8220;DBI:mysql:database=&#8221;.$name.&#8217;;host=&#8217;.$hostname, $user, $password,
{
RaiseError        =&#62; $raise,
#             AutoCommit        =&#62; 1,
mysql_enable_utf8 =&#62; 1,
on_connect_do =&#62; [ "SET NAMES 'utf8'", "SET CHARACTER SET +'utf8'" ],
})) {
$dbh-&#62;{&#8216;mysql_enable_utf8&#8242;} = 1;
return $dbh; # DBI database handler
}
We [...]


See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-lamp-encod' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode'>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-application-charse' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; binmode, charset'>Utf8 in web perl application (LAMP) &#8211; binmode, charset</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Horror with utf8 and LAMP ( perl ) web application contiunued:</p>
<p>We need to take care of  mysql connection, so it is ut8 &#8211; ready:</p>
<blockquote><p>if (my $dbh = DBI-&gt;connect(&#8220;DBI:mysql:database=&#8221;.$name.&#8217;;host=&#8217;.$hostname, $user, $password,<br />
{<br />
RaiseError        =&gt; $raise,<br />
#             AutoCommit        =&gt; 1,<br />
mysql_enable_utf8 =&gt; 1,<br />
on_connect_do =&gt; [ "SET NAMES 'utf8'", "SET CHARACTER SET +'utf8'" ],<br />
})) {</p>
<p>$dbh-&gt;{&#8216;mysql_enable_utf8&#8242;} = 1;<br />
return $dbh; # DBI database handler<br />
}</p></blockquote>
<p>We also must make sure that our tables are unicode:</p>
<blockquote><p>CREATE TABLE `foo` (<br />
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,<br />
&#8230;.</p>
<p>)  DEFAULT CHARSET=utf8</p></blockquote>
<p>And remember, that utf8 chars may take more space than normal &#8211; so prepare longer  varchars in tables and be prepared for problem with  indexes, like this: Specified key was too long; max key length is 1000 bytes &#8211; see <a href="http://bugs.mysql.com/bug.php?id=4541">http://bugs.mysql.com/bug.php?id=4541</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql&amp;bodytext=Horror%20with%20utf8%20and%20LAMP%20%28%20perl%20%29%20web%20application%20contiunued%3A%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%C2%A0%20mysql%20connection%2C%20so%20it%20is%20ut8%20-%20ready%3A%0D%0Aif%20%28my%20%24dbh%20%3D%20DBI-%26gt%3Bconnect%28%22DBI%3Amysql%3Adatabase%3D%22.%24name.%27%3Bhost%3D%27.%24hostname%2C%20%24user%2C%20%24password%2C%0D%0A%7B%0D%0ARaiseError%C2%A0%C2%A0%C2%A0%C2" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql&amp;notes=Horror%20with%20utf8%20and%20LAMP%20%28%20perl%20%29%20web%20application%20contiunued%3A%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%C2%A0%20mysql%20connection%2C%20so%20it%20is%20ut8%20-%20ready%3A%0D%0Aif%20%28my%20%24dbh%20%3D%20DBI-%26gt%3Bconnect%28%22DBI%3Amysql%3Adatabase%3D%22.%24name.%27%3Bhost%3D%27.%24hostname%2C%20%24user%2C%20%24password%2C%0D%0A%7B%0D%0ARaiseError%C2%A0%C2%A0%C2%A0%C2" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql&amp;annotation=Horror%20with%20utf8%20and%20LAMP%20%28%20perl%20%29%20web%20application%20contiunued%3A%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%C2%A0%20mysql%20connection%2C%20so%20it%20is%20ut8%20-%20ready%3A%0D%0Aif%20%28my%20%24dbh%20%3D%20DBI-%26gt%3Bconnect%28%22DBI%3Amysql%3Adatabase%3D%22.%24name.%27%3Bhost%3D%27.%24hostname%2C%20%24user%2C%20%24password%2C%0D%0A%7B%0D%0ARaiseError%C2%A0%C2%A0%C2%A0%C2" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=Horror%20with%20utf8%20and%20LAMP%20%28%20perl%20%29%20web%20application%20contiunued%3A%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%C2%A0%20mysql%20connection%2C%20so%20it%20is%20ut8%20-%20ready%3A%0D%0Aif%20%28my%20%24dbh%20%3D%20DBI-%26gt%3Bconnect%28%22DBI%3Amysql%3Adatabase%3D%22.%24name.%27%3Bhost%3D%27.%24hostname%2C%20%24user%2C%20%24password%2C%0D%0A%7B%0D%0ARaiseError%C2%A0%C2%A0%C2%A0%C2" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi%20Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql%20-%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql&opener=bm&amp;ei=UTF-8&amp;d=Horror%20with%20utf8%20and%20LAMP%20%28%20perl%20%29%20web%20application%20contiunued%3A%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%C2%A0%20mysql%20connection%2C%20so%20it%20is%20ut8%20-%20ready%3A%0D%0Aif%20%28my%20%24dbh%20%3D%20DBI-%26gt%3Bconnect%28%22DBI%3Amysql%3Adatabase%3D%22.%24name.%27%3Bhost%3D%27.%24hostname%2C%20%24user%2C%20%24password%2C%0D%0A%7B%0D%0ARaiseError%C2%A0%C2%A0%C2%A0%C2" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-perl-application-lamp-dbi&amp;submitHeadline=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20dbi%2C%20mysql&amp;submitSummary=Horror%20with%20utf8%20and%20LAMP%20%28%20perl%20%29%20web%20application%20contiunued%3A%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%C2%A0%20mysql%20connection%2C%20so%20it%20is%20ut8%20-%20ready%3A%0D%0Aif%20%28my%20%24dbh%20%3D%20DBI-%26gt%3Bconnect%28%22DBI%3Amysql%3Adatabase%3D%22.%24name.%27%3Bhost%3D%27.%24hostname%2C%20%24user%2C%20%24password%2C%0D%0A%7B%0D%0ARaiseError%C2%A0%C2%A0%C2%A0%C2&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-lamp-encod' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode'>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-application-charse' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; binmode, charset'>Utf8 in web perl application (LAMP) &#8211; binmode, charset</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utf8 in web perl application (LAMP) &#8211; binmode, charset</title>
		<link>http://perl.baczynski.com/work/utf8-web-perl-application-charse</link>
		<comments>http://perl.baczynski.com/work/utf8-web-perl-application-charse#comments</comments>
		<pubDate>Wed, 16 Dec 2009 04:57:28 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=158</guid>
		<description><![CDATA[After wrestling with perl encoding, we need to make sure the pages of website we create are displayed in utf8.
This means we need to have proper header in pages, for example:
&#60;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/html4/loose.dtd&#8221;&#62;
&#60;html&#62;
&#60;head&#62;
&#60;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=UTF-8&#8243;&#62;
&#8230;
&#8230;
&#8230;
&#60;/head&#62;
&#60;body&#62;
and/or:
Content-Type: text/html; charset=utf-8
Second step, is to set binmode on STDOUT (if we print our dynamically [...]


See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-horror-at-lamp-part-5' rel='bookmark' title='Permanent Link: Utf8 horror at LAMP &#8211; accept charset'>Utf8 horror at LAMP &#8211; accept charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-lamp-encod' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode'>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After wrestling with perl encoding, we need to make sure the pages of website we create are displayed in utf8.<br />
This means we need to have proper header in pages, for example:</p>
<blockquote><p>&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.01 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/html4/loose.dtd&#8221;&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=UTF-8&#8243;&gt;<br />
&#8230;<br />
&#8230;<br />
&#8230;<br />
&lt;/head&gt;<br />
&lt;body&gt;</p></blockquote>
<p>and/or:</p>
<blockquote><p>Content-Type: text/html; charset=utf-8</p></blockquote>
<p>Second step, is to set binmode on STDOUT (if we print our dynamically generated webpages)</p>
<p><strong>binmode STDOUT, &#8220;:utf8&#8243;;</strong></p>
<p>to get rid of</p>
<blockquote><p>Wide character in print at &#8230;</p></blockquote>
<p>warnings.</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset&amp;bodytext=After%20wrestling%20with%20perl%20encoding%2C%20we%20need%20to%20make%20sure%20the%20pages%20of%20website%20we%20create%20are%20displayed%20in%20utf8.%0D%0AThis%20means%20we%20need%20to%20have%20proper%20header%20in%20pages%2C%20for%20example%3A%0D%0A%26lt%3B%21DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.01%20Transitional%2F%2FEN%22%20%22http%3A%2F" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset&amp;notes=After%20wrestling%20with%20perl%20encoding%2C%20we%20need%20to%20make%20sure%20the%20pages%20of%20website%20we%20create%20are%20displayed%20in%20utf8.%0D%0AThis%20means%20we%20need%20to%20have%20proper%20header%20in%20pages%2C%20for%20example%3A%0D%0A%26lt%3B%21DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.01%20Transitional%2F%2FEN%22%20%22http%3A%2F" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset&amp;annotation=After%20wrestling%20with%20perl%20encoding%2C%20we%20need%20to%20make%20sure%20the%20pages%20of%20website%20we%20create%20are%20displayed%20in%20utf8.%0D%0AThis%20means%20we%20need%20to%20have%20proper%20header%20in%20pages%2C%20for%20example%3A%0D%0A%26lt%3B%21DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.01%20Transitional%2F%2FEN%22%20%22http%3A%2F" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=After%20wrestling%20with%20perl%20encoding%2C%20we%20need%20to%20make%20sure%20the%20pages%20of%20website%20we%20create%20are%20displayed%20in%20utf8.%0D%0AThis%20means%20we%20need%20to%20have%20proper%20header%20in%20pages%2C%20for%20example%3A%0D%0A%26lt%3B%21DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.01%20Transitional%2F%2FEN%22%20%22http%3A%2F" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse%20Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset%20-%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset&opener=bm&amp;ei=UTF-8&amp;d=After%20wrestling%20with%20perl%20encoding%2C%20we%20need%20to%20make%20sure%20the%20pages%20of%20website%20we%20create%20are%20displayed%20in%20utf8.%0D%0AThis%20means%20we%20need%20to%20have%20proper%20header%20in%20pages%2C%20for%20example%3A%0D%0A%26lt%3B%21DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.01%20Transitional%2F%2FEN%22%20%22http%3A%2F" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-application-charse&amp;submitHeadline=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20binmode%2C%20charset&amp;submitSummary=After%20wrestling%20with%20perl%20encoding%2C%20we%20need%20to%20make%20sure%20the%20pages%20of%20website%20we%20create%20are%20displayed%20in%20utf8.%0D%0AThis%20means%20we%20need%20to%20have%20proper%20header%20in%20pages%2C%20for%20example%3A%0D%0A%26lt%3B%21DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.01%20Transitional%2F%2FEN%22%20%22http%3A%2F&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-horror-at-lamp-part-5' rel='bookmark' title='Permanent Link: Utf8 horror at LAMP &#8211; accept charset'>Utf8 horror at LAMP &#8211; accept charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-lamp-encod' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode'>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/work/utf8-web-perl-application-charse/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</title>
		<link>http://perl.baczynski.com/work/utf8-web-perl-lamp-encod</link>
		<comments>http://perl.baczynski.com/work/utf8-web-perl-lamp-encod#comments</comments>
		<pubDate>Wed, 09 Dec 2009 04:57:56 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=155</guid>
		<description><![CDATA[The data we get from outside (like STDIN) is usually binary data.
Command like uc, lc wants text strings.
Here is how to change binary data to text strings:
use Encode ;
$foo = Encode::decode_utf8($foo);
you can also convert from other encodings:
$data = decode(&#8220;iso-8859-2&#8243;, $data);
To check whether a string have utf flag turned on:
use Encode qw(is_utf8);
print is_utf8($foo) ? &#8220;utf8&#8243; : [...]


See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-application-charse' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; binmode, charset'>Utf8 in web perl application (LAMP) &#8211; binmode, charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The data we get from outside (like STDIN) is usually binary data.<br />
Command like uc, lc wants text strings.</p>
<p>Here is how to change binary data to text strings:</p>
<p>use Encode ;<br />
$foo = Encode::decode_utf8($foo);</p>
<p>you can also convert from other encodings:<br />
$data = decode(&#8220;iso-8859-2&#8243;, $data);</p>
<p>To check whether a string have utf flag turned on:</p>
<p>use Encode qw(is_utf8);<br />
print is_utf8($foo) ? &#8220;utf8&#8243; : &#8220;not utf8&#8243;</p>
<p>If you do not know what encoding is the data, use perl module:<br />
use Encode::Guess;<br />
my $enc = guess_encoding($data, qw/euc-jp shiftjis 7bit-jis/);</p>
<p>You need to tell explicitly which encodings are suspected, because<br />
by default, it checks only ascii, utf8 and UTF-16/32 with BOM.</p>
<p>Encode::Guess-&gt;set_suspects(qw/euc-jp shiftjis 7bit-jis/);</p>
<p>But remember, that the guessing is not magic, and it likely to fail.<br />
For example it may fail to recognize whether data are in is-8859-1 or iso-8859-2<br />
Because:</p>
<blockquote><p>The reason is that Encode::Guess guesses encoding by trial and error. It first splits $data into lines and tries to decode the line for each suspect. It keeps it going until all but one encoding is eliminated out of suspects list. ISO-8859 series is just too successful for most cases (because it fills almost all code points in \x00-\xff).</p></blockquote>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode&amp;bodytext=The%20data%20we%20get%20from%20outside%20%28like%20STDIN%29%20is%20usually%20binary%20data.%0D%0ACommand%20like%20uc%2C%20lc%20wants%20text%20strings.%0D%0A%0D%0AHere%20is%20how%20to%20change%20binary%20data%20to%20text%20strings%3A%0D%0A%0D%0Ause%20Encode%20%3B%0D%0A%24foo%20%3D%20Encode%3A%3Adecode_utf8%28%24foo%29%3B%0D%0A%0D%0Ayou%20can%20also%20convert%20from%20other%20enc" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode&amp;notes=The%20data%20we%20get%20from%20outside%20%28like%20STDIN%29%20is%20usually%20binary%20data.%0D%0ACommand%20like%20uc%2C%20lc%20wants%20text%20strings.%0D%0A%0D%0AHere%20is%20how%20to%20change%20binary%20data%20to%20text%20strings%3A%0D%0A%0D%0Ause%20Encode%20%3B%0D%0A%24foo%20%3D%20Encode%3A%3Adecode_utf8%28%24foo%29%3B%0D%0A%0D%0Ayou%20can%20also%20convert%20from%20other%20enc" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode&amp;annotation=The%20data%20we%20get%20from%20outside%20%28like%20STDIN%29%20is%20usually%20binary%20data.%0D%0ACommand%20like%20uc%2C%20lc%20wants%20text%20strings.%0D%0A%0D%0AHere%20is%20how%20to%20change%20binary%20data%20to%20text%20strings%3A%0D%0A%0D%0Ause%20Encode%20%3B%0D%0A%24foo%20%3D%20Encode%3A%3Adecode_utf8%28%24foo%29%3B%0D%0A%0D%0Ayou%20can%20also%20convert%20from%20other%20enc" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=The%20data%20we%20get%20from%20outside%20%28like%20STDIN%29%20is%20usually%20binary%20data.%0D%0ACommand%20like%20uc%2C%20lc%20wants%20text%20strings.%0D%0A%0D%0AHere%20is%20how%20to%20change%20binary%20data%20to%20text%20strings%3A%0D%0A%0D%0Ause%20Encode%20%3B%0D%0A%24foo%20%3D%20Encode%3A%3Adecode_utf8%28%24foo%29%3B%0D%0A%0D%0Ayou%20can%20also%20convert%20from%20other%20enc" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod%20Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode%20-%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode&opener=bm&amp;ei=UTF-8&amp;d=The%20data%20we%20get%20from%20outside%20%28like%20STDIN%29%20is%20usually%20binary%20data.%0D%0ACommand%20like%20uc%2C%20lc%20wants%20text%20strings.%0D%0A%0D%0AHere%20is%20how%20to%20change%20binary%20data%20to%20text%20strings%3A%0D%0A%0D%0Ause%20Encode%20%3B%0D%0A%24foo%20%3D%20Encode%3A%3Adecode_utf8%28%24foo%29%3B%0D%0A%0D%0Ayou%20can%20also%20convert%20from%20other%20enc" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-perl-lamp-encod&amp;submitHeadline=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20part%202%20-%20Encode&amp;submitSummary=The%20data%20we%20get%20from%20outside%20%28like%20STDIN%29%20is%20usually%20binary%20data.%0D%0ACommand%20like%20uc%2C%20lc%20wants%20text%20strings.%0D%0A%0D%0AHere%20is%20how%20to%20change%20binary%20data%20to%20text%20strings%3A%0D%0A%0D%0Ause%20Encode%20%3B%0D%0A%24foo%20%3D%20Encode%3A%3Adecode_utf8%28%24foo%29%3B%0D%0A%0D%0Ayou%20can%20also%20convert%20from%20other%20enc&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-application-charse' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; binmode, charset'>Utf8 in web perl application (LAMP) &#8211; binmode, charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/work/utf8-web-perl-lamp-encod/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Utf8 in web perl application (LAMP)</title>
		<link>http://perl.baczynski.com/work/utf8-web-application-lamp</link>
		<comments>http://perl.baczynski.com/work/utf8-web-application-lamp#comments</comments>
		<pubDate>Wed, 02 Dec 2009 04:45:40 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=147</guid>
		<description><![CDATA[Making a correct utf8 web application in LAMP (Perl) is not easy. There are lots of dangerous traps along the way.
We need to take care of source code encoding, web forms data &#8211; inputed by user -  encoding, mysql encoding, displaying data (writing) encoding, and perhaps also take care of data taken from disk files.
First, [...]


See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-perl-lamp-encod' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode'>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-application-charse' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; binmode, charset'>Utf8 in web perl application (LAMP) &#8211; binmode, charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Making a correct utf8 web application in LAMP (Perl) is not easy. There are lots of dangerous traps along the way.</p>
<p>We need to take care of source code encoding, web forms data &#8211; inputed by user -  encoding, mysql encoding, displaying data (writing) encoding, and perhaps also take care of data taken from disk files.</p>
<p>First, we need to take care of source code, if we want to write there something like</p>
<p><strong>$var = &#8220;zażółć gęślą jaźń&#8221;</strong></p>
<p>we need  to <strong>use utf8</strong></p>
<blockquote><p>The use utf8 pragma tells the Perl parser to allow UTF-8 in the program text in the current lexical scope</p>
<p>Do not use this pragma for anything else than telling Perl that your script is written in UTF-8.</p></blockquote>
<p><strong>use utf8</strong> is not a magical trick to fix all problems with utf8, just a beginning of the journey&#8230;</p>
<p>We must have a good code editor or IDE that understands utf8. It will be also nice to have possibility to open files with other other encodings and convert them to utf8. For unix/linux there is for example KDevelop, and many other tools. For windows, there are many editors too. See: <a title="editors unicode" href="http://en.wikipedia.org/wiki/Comparison_of_text_editors#Unicode_and_other_character_encodings">http://en.wikipedia.org/wiki/Comparison_of_text_editors#Unicode_and_other_character_encodings</a> and <a title="editors unicode part 2" href="http://www.alanwood.net/unicode/utilities_editors.html">http://www.alanwood.net/unicode/utilities_editors.html</a></p>
<p>When using <strong>use utf8</strong> remember to save code in utf8 encoding!</p>
<p>To be continued&#8230;</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29&amp;bodytext=Making%20a%20correct%20utf8%20web%20application%20in%20LAMP%20%28Perl%29%20is%20not%20easy.%20There%20are%20lots%20of%20dangerous%20traps%20along%20the%20way.%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%20source%20code%20encoding%2C%20web%20forms%20data%20-%20inputed%20by%20user%20-%C2%A0%20encoding%2C%20mysql%20encoding%2C%20displaying%20data%20%28writin" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29&amp;notes=Making%20a%20correct%20utf8%20web%20application%20in%20LAMP%20%28Perl%29%20is%20not%20easy.%20There%20are%20lots%20of%20dangerous%20traps%20along%20the%20way.%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%20source%20code%20encoding%2C%20web%20forms%20data%20-%20inputed%20by%20user%20-%C2%A0%20encoding%2C%20mysql%20encoding%2C%20displaying%20data%20%28writin" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29&amp;annotation=Making%20a%20correct%20utf8%20web%20application%20in%20LAMP%20%28Perl%29%20is%20not%20easy.%20There%20are%20lots%20of%20dangerous%20traps%20along%20the%20way.%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%20source%20code%20encoding%2C%20web%20forms%20data%20-%20inputed%20by%20user%20-%C2%A0%20encoding%2C%20mysql%20encoding%2C%20displaying%20data%20%28writin" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Utf8%20in%20web%20perl%20application%20%28LAMP%29&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=Making%20a%20correct%20utf8%20web%20application%20in%20LAMP%20%28Perl%29%20is%20not%20easy.%20There%20are%20lots%20of%20dangerous%20traps%20along%20the%20way.%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%20source%20code%20encoding%2C%20web%20forms%20data%20-%20inputed%20by%20user%20-%C2%A0%20encoding%2C%20mysql%20encoding%2C%20displaying%20data%20%28writin" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Utf8%20in%20web%20perl%20application%20%28LAMP%29&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;title=Utf8%20in%20web%20perl%20application%20%28LAMP%29" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp%20Utf8%20in%20web%20perl%20application%20%28LAMP%29" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Utf8%20in%20web%20perl%20application%20%28LAMP%29%20-%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;t=Utf8%20in%20web%20perl%20application%20%28LAMP%29&opener=bm&amp;ei=UTF-8&amp;d=Making%20a%20correct%20utf8%20web%20application%20in%20LAMP%20%28Perl%29%20is%20not%20easy.%20There%20are%20lots%20of%20dangerous%20traps%20along%20the%20way.%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%20source%20code%20encoding%2C%20web%20forms%20data%20-%20inputed%20by%20user%20-%C2%A0%20encoding%2C%20mysql%20encoding%2C%20displaying%20data%20%28writin" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Futf8-web-application-lamp&amp;submitHeadline=Utf8%20in%20web%20perl%20application%20%28LAMP%29&amp;submitSummary=Making%20a%20correct%20utf8%20web%20application%20in%20LAMP%20%28Perl%29%20is%20not%20easy.%20There%20are%20lots%20of%20dangerous%20traps%20along%20the%20way.%0D%0A%0D%0AWe%20need%20to%20take%20care%20of%20source%20code%20encoding%2C%20web%20forms%20data%20-%20inputed%20by%20user%20-%C2%A0%20encoding%2C%20mysql%20encoding%2C%20displaying%20data%20%28writin&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/work/utf8-web-perl-lamp-encod' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode'>Utf8 in web perl application (LAMP) &#8211; part 2 &#8211; Encode</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-perl-application-charse' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; binmode, charset'>Utf8 in web perl application (LAMP) &#8211; binmode, charset</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/work/utf8-web-application-lamp/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Website authorization &#8211; my solution</title>
		<link>http://perl.baczynski.com/cpan/website-authorization-my-solution</link>
		<comments>http://perl.baczynski.com/cpan/website-authorization-my-solution#comments</comments>
		<pubDate>Wed, 11 Nov 2009 04:37:25 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[cpan]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[authorization]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=130</guid>
		<description><![CDATA[I wrote about wondering how to make &#8220;login&#8221; to a dynamic website in Perl. The best solution advised by http://perldesignpatterns.com/?WebAuthentication was to make a temporary token: &#8220;cookie with an authorization token. Store the token in the database along with an expiration time separate of the cookie. The token should be random generated and completely seperate [...]


See also:<ol><li><a href='http://perl.baczynski.com/work/website-login-with-perl' rel='bookmark' title='Permanent Link: Website login with Perl'>Website login with Perl</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
<li><a href='http://perl.baczynski.com/work/rocketaware-perl-resources' rel='bookmark' title='Permanent Link: Rocketaware &#8211; perl resources'>Rocketaware &#8211; perl resources</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I wrote <a title="Perl website login" href="http://perl.baczynski.com/work/website-login-with-perl">about wondering how to make &#8220;login&#8221;</a> to a dynamic website in Perl. The best solution advised by <a href="http://perldesignpatterns.com/?WebAuthentication">http://perldesignpatterns.com/?WebAuthentication</a> was to make a temporary token: &#8220;cookie with an authorization token. Store the token in the database along with an expiration time separate of the cookie. The token should be random generated and completely seperate from the password but handed out when the password is validated. This is the best case;&#8221;, but it was overshot for now, so I settled up for this scheme:</p>
<p>Whan user registers, his password is stored as md5 digest in database. Salt is generated &#8211; string of eight random letters, numbers etc.I use Crypt::PasswdMD5 qw(unix_md5_crypt);</p>
<p>When user logs in, password is checked-  crypted using crypted pass from database as salt:</p>
<p>if ( $cryptedpassword eq unix_md5_crypt($password, $cryptedpassword)) {</p>
<p>and if it is ok, cookie is stored with user ID and crypted password.</p>
<p>The cookie is then checked on every page, whether it contains the crypted password from database.</p>
<p>Well, this is my idea of doing it for now, already implemented, I feel a bit unease about that &#8211; what is the point of crypting password and storing it crypted, as it really matters whether the pass from cookie is equal to pass in database &#8211; it could be not crypted and it would work the same way.</p>
<p>The only advantage is that the password is not stored in cookie &#8211; but it is not needed, as just the digest is needed to pretend to be logged in.</p>
<p>What do you think?</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;title=Website%20authorization%20-%20my%20solution&amp;bodytext=I%20wrote%20about%20wondering%20how%20to%20make%20%22login%22%20to%20a%20dynamic%20website%20in%20Perl.%20The%20best%20solution%20advised%20by%20http%3A%2F%2Fperldesignpatterns.com%2F%3FWebAuthentication%20was%20to%20make%20a%20temporary%20token%3A%20%22cookie%20with%20an%20authorization%20token.%20Store%20the%20token%20in%20the%20databas" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;title=Website%20authorization%20-%20my%20solution&amp;notes=I%20wrote%20about%20wondering%20how%20to%20make%20%22login%22%20to%20a%20dynamic%20website%20in%20Perl.%20The%20best%20solution%20advised%20by%20http%3A%2F%2Fperldesignpatterns.com%2F%3FWebAuthentication%20was%20to%20make%20a%20temporary%20token%3A%20%22cookie%20with%20an%20authorization%20token.%20Store%20the%20token%20in%20the%20databas" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;t=Website%20authorization%20-%20my%20solution" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;title=Website%20authorization%20-%20my%20solution" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;title=Website%20authorization%20-%20my%20solution&amp;annotation=I%20wrote%20about%20wondering%20how%20to%20make%20%22login%22%20to%20a%20dynamic%20website%20in%20Perl.%20The%20best%20solution%20advised%20by%20http%3A%2F%2Fperldesignpatterns.com%2F%3FWebAuthentication%20was%20to%20make%20a%20temporary%20token%3A%20%22cookie%20with%20an%20authorization%20token.%20Store%20the%20token%20in%20the%20databas" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Website%20authorization%20-%20my%20solution&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;title=Website%20authorization%20-%20my%20solution&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=I%20wrote%20about%20wondering%20how%20to%20make%20%22login%22%20to%20a%20dynamic%20website%20in%20Perl.%20The%20best%20solution%20advised%20by%20http%3A%2F%2Fperldesignpatterns.com%2F%3FWebAuthentication%20was%20to%20make%20a%20temporary%20token%3A%20%22cookie%20with%20an%20authorization%20token.%20Store%20the%20token%20in%20the%20databas" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;t=Website%20authorization%20-%20my%20solution" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;title=Website%20authorization%20-%20my%20solution" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Website%20authorization%20-%20my%20solution&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;title=Website%20authorization%20-%20my%20solution" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution%20Website%20authorization%20-%20my%20solution" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Website%20authorization%20-%20my%20solution%20-%20http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;t=Website%20authorization%20-%20my%20solution&opener=bm&amp;ei=UTF-8&amp;d=I%20wrote%20about%20wondering%20how%20to%20make%20%22login%22%20to%20a%20dynamic%20website%20in%20Perl.%20The%20best%20solution%20advised%20by%20http%3A%2F%2Fperldesignpatterns.com%2F%3FWebAuthentication%20was%20to%20make%20a%20temporary%20token%3A%20%22cookie%20with%20an%20authorization%20token.%20Store%20the%20token%20in%20the%20databas" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fcpan%2Fwebsite-authorization-my-solution&amp;submitHeadline=Website%20authorization%20-%20my%20solution&amp;submitSummary=I%20wrote%20about%20wondering%20how%20to%20make%20%22login%22%20to%20a%20dynamic%20website%20in%20Perl.%20The%20best%20solution%20advised%20by%20http%3A%2F%2Fperldesignpatterns.com%2F%3FWebAuthentication%20was%20to%20make%20a%20temporary%20token%3A%20%22cookie%20with%20an%20authorization%20token.%20Store%20the%20token%20in%20the%20databas&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/work/website-login-with-perl' rel='bookmark' title='Permanent Link: Website login with Perl'>Website login with Perl</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-perl-application-lamp-dbi' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP) &#8211; dbi, mysql'>Utf8 in web perl application (LAMP) &#8211; dbi, mysql</a></li>
<li><a href='http://perl.baczynski.com/work/rocketaware-perl-resources' rel='bookmark' title='Permanent Link: Rocketaware &#8211; perl resources'>Rocketaware &#8211; perl resources</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/cpan/website-authorization-my-solution/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Website login with Perl</title>
		<link>http://perl.baczynski.com/work/website-login-with-perl</link>
		<comments>http://perl.baczynski.com/work/website-login-with-perl#comments</comments>
		<pubDate>Tue, 27 Oct 2009 04:55:49 +0000</pubDate>
		<dc:creator>Lech</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[authorization]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://perl.baczynski.com/?p=116</guid>
		<description><![CDATA[Lately I was thinking about implementing logging (as in login/password) into a website with Perl. I mean, that I want to have a dynamic website, where users can login using login and password and do some stuff.
After googling for &#8220;how to make login site&#8221; mostly PHP session solutions came up. When I added &#8220;perl&#8221; to [...]


See also:<ol><li><a href='http://perl.baczynski.com/cpan/website-authorization-my-solution' rel='bookmark' title='Permanent Link: Website authorization &#8211; my solution'>Website authorization &#8211; my solution</a></li>
<li><a href='http://perl.baczynski.com/work/masons-and-mason' rel='bookmark' title='Permanent Link: Masons and mason'>Masons and mason</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Lately I was thinking about implementing logging (as in login/password) into a website with Perl. I mean, that I want to have a dynamic website, where users can login using login and password and do some stuff.</p>
<p>After googling for &#8220;how to make login site&#8221; mostly PHP session solutions came up. When I added &#8220;perl&#8221; to that google query, half of results was about logging into <strong>someone&#8217;s </strong>website (wget, LWP, WWW::Mechanize etc) and not making a login feature in existing dynamic website. Search for &#8220;perl authentication&#8221; found more relevant stuff.</p>
<p>Some pages suggested using .htaccess. Bleh. Beside, I want to have user in a SQL database.</p>
<p>One result pointed to CGI::Session on cpan. Nice. CGI::Session::Auth &#8211; nice too <img src='http://perl.baczynski.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  There is also Apache::Session to be found on cpan.</p>
<p>There was also a hint, to find a perl web forum script and see how it is done there. We&#8217;ll, I did it with one forum script, and found that user login and crypted password is stored in a cookie. Nice.</p>
<p>There also books that talk about how to do web authentication: <a href="http://astore.amazon.com/lechsarchaeopage/detail/1565926471">Perl for Web Site Management</a> or <a href="http://astore.amazon.com/lechsarchaeopage/detail/1565924193">CGI programming with Perl</a></p>
<p>Here we have some design patterns: <a href="http://perldesignpatterns.com/?WebAuthentication">http://perldesignpatterns.com/?WebAuthentication</a> and also: <a href="http://perldesignpatterns.com/?SessionPattern" target="_blank">http://perldesignpatterns.com/?SessionPattern</a> and <a href="http://perldesignpatterns.com/?PerlDesignPatterns" target="_blank">http://perldesignpatterns.com/?PerlDesignPatterns</a> . Even nicer <img src='http://perl.baczynski.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But I still look for ultimate &#8220;how to&#8221; with examples about authorizing users (register, login, remind password etc.)  into some kind of dynamic website with Perl. Any hints?</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;partner=sociable" title="Print"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;title=Website%20login%20with%20Perl&amp;bodytext=Lately%20I%20was%20thinking%20about%20implementing%20logging%20%28as%20in%20login%2Fpassword%29%20into%20a%20website%20with%20Perl.%20I%20mean%2C%20that%20I%20want%20to%20have%20a%20dynamic%20website%2C%20where%20users%20can%20login%20using%20login%20and%20password%20and%20do%20some%20stuff.%0D%0A%0D%0AAfter%20googling%20for%20%22how%20to%20make%20logi" title="Digg"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;title=Website%20login%20with%20Perl&amp;notes=Lately%20I%20was%20thinking%20about%20implementing%20logging%20%28as%20in%20login%2Fpassword%29%20into%20a%20website%20with%20Perl.%20I%20mean%2C%20that%20I%20want%20to%20have%20a%20dynamic%20website%2C%20where%20users%20can%20login%20using%20login%20and%20password%20and%20do%20some%20stuff.%0D%0A%0D%0AAfter%20googling%20for%20%22how%20to%20make%20logi" title="del.icio.us"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;t=Website%20login%20with%20Perl" title="Facebook"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;title=Website%20login%20with%20Perl" title="Mixx"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;title=Website%20login%20with%20Perl&amp;annotation=Lately%20I%20was%20thinking%20about%20implementing%20logging%20%28as%20in%20login%2Fpassword%29%20into%20a%20website%20with%20Perl.%20I%20mean%2C%20that%20I%20want%20to%20have%20a%20dynamic%20website%2C%20where%20users%20can%20login%20using%20login%20and%20password%20and%20do%20some%20stuff.%0D%0A%0D%0AAfter%20googling%20for%20%22how%20to%20make%20logi" title="Google Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Website%20login%20with%20Perl&amp;body=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl" title="email"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;title=Website%20login%20with%20Perl&amp;source=Perl+Perl%2C+CPAN%2C+YAPC...+et+ceatera&amp;summary=Lately%20I%20was%20thinking%20about%20implementing%20logging%20%28as%20in%20login%2Fpassword%29%20into%20a%20website%20with%20Perl.%20I%20mean%2C%20that%20I%20want%20to%20have%20a%20dynamic%20website%2C%20where%20users%20can%20login%20using%20login%20and%20password%20and%20do%20some%20stuff.%0D%0A%0D%0AAfter%20googling%20for%20%22how%20to%20make%20logi" title="LinkedIn"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;t=Website%20login%20with%20Perl" title="MySpace"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;title=Website%20login%20with%20Perl" title="Reddit"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://perl.baczynski.com/feed" title="RSS"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Website%20login%20with%20Perl&amp;url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl" title="Slashdot"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;title=Website%20login%20with%20Perl" title="StumbleUpon"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home/?status=tip%20@Techmeme%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl%20Website%20login%20with%20Perl" title="Suggest to Techmeme via Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/techmeme.png" title="Suggest to Techmeme via Twitter" alt="Suggest to Techmeme via Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl" title="Technorati"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Website%20login%20with%20Perl%20-%20http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl" title="Twitter"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;t=Website%20login%20with%20Perl&opener=bm&amp;ei=UTF-8&amp;d=Lately%20I%20was%20thinking%20about%20implementing%20logging%20%28as%20in%20login%2Fpassword%29%20into%20a%20website%20with%20Perl.%20I%20mean%2C%20that%20I%20want%20to%20have%20a%20dynamic%20website%2C%20where%20users%20can%20login%20using%20login%20and%20password%20and%20do%20some%20stuff.%0D%0A%0D%0AAfter%20googling%20for%20%22how%20to%20make%20logi" title="Yahoo! Bookmarks"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fperl.baczynski.com%2Fwork%2Fwebsite-login-with-perl&amp;submitHeadline=Website%20login%20with%20Perl&amp;submitSummary=Lately%20I%20was%20thinking%20about%20implementing%20logging%20%28as%20in%20login%2Fpassword%29%20into%20a%20website%20with%20Perl.%20I%20mean%2C%20that%20I%20want%20to%20have%20a%20dynamic%20website%2C%20where%20users%20can%20login%20using%20login%20and%20password%20and%20do%20some%20stuff.%0D%0A%0D%0AAfter%20googling%20for%20%22how%20to%20make%20logi&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://perl.baczynski.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a>


<br/><br/>

<p>See also:<ol><li><a href='http://perl.baczynski.com/cpan/website-authorization-my-solution' rel='bookmark' title='Permanent Link: Website authorization &#8211; my solution'>Website authorization &#8211; my solution</a></li>
<li><a href='http://perl.baczynski.com/work/masons-and-mason' rel='bookmark' title='Permanent Link: Masons and mason'>Masons and mason</a></li>
<li><a href='http://perl.baczynski.com/work/utf8-web-application-lamp' rel='bookmark' title='Permanent Link: Utf8 in web perl application (LAMP)'>Utf8 in web perl application (LAMP)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://perl.baczynski.com/work/website-login-with-perl/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
