<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Utf8 in web perl application (LAMP)</title>
	<atom:link href="http://perl.baczynski.com/work/utf8-web-application-lamp/feed" rel="self" type="application/rss+xml" />
	<link>http://perl.baczynski.com/work/utf8-web-application-lamp</link>
	<description>Perl, CPAN, YAPC... et ceatera</description>
	<lastBuildDate>Thu, 28 Jul 2011 08:50:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: admin</title>
		<link>http://perl.baczynski.com/work/utf8-web-application-lamp/comment-page-1#comment-124</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 02 Dec 2009 12:57:06 +0000</pubDate>
		<guid isPermaLink="false">http://perl.baczynski.com/?p=147#comment-124</guid>
		<description>Thaks for comments Sid :) This will be covered in next parts of the series, that were already written and scheduled :)
If you&#039;ll find anything wrong or not enough described in the serie (this post and next ones), please write a comment. Thanks!</description>
		<content:encoded><![CDATA[<p>Thaks for comments Sid <img src='http://perl.baczynski.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This will be covered in next parts of the series, that were already written and scheduled <img src='http://perl.baczynski.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
If you&#8217;ll find anything wrong or not enough described in the serie (this post and next ones), please write a comment. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sid Burn</title>
		<link>http://perl.baczynski.com/work/utf8-web-application-lamp/comment-page-1#comment-123</link>
		<dc:creator>Sid Burn</dc:creator>
		<pubDate>Wed, 02 Dec 2009 11:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://perl.baczynski.com/?p=147#comment-123</guid>
		<description>Here is another bit of code with UTF-8 Handling in Perl. The important part of the &quot;utf8&quot; documentation is:

&gt; &quot;Bytes in the source text that have their high-bit set will be treated as being part of a literal UTF-X sequence.&quot;

&gt; #!/usr/bin/env perl
&gt; # Core Module
&gt; use strict;
&gt; use warnings;
&gt; use utf8;
&gt; # If you print string out to (file)handles that has UTF-8 Flag on, 
&gt; # perl does automatically encode everything to &quot;ISO-8859-1&quot;
&gt; # is also does this with STD*  With this line of code we say that 
&gt; # &quot;all&quot; handles should encode everything to UTF-8
&gt; use open &#039;:encoding(UTF-8)&#039;;
&gt; # But &quot;all&quot; is a lie, it does this not with the &quot;STD*&quot; Handles
&gt; # With this line we say that the STD* handles gets the same threatment.
&gt; # You need this if your terminal is already (UTF-8) (today any Linux
&gt; # Distribution should have this)
&gt; use open &#039;:std&#039;;
&gt; 
&gt; # &quot;Hello, World!&quot; in german
&gt; my $world = &#039;Hallo, Welt!&#039;;
&gt; print utf8::is_utf8($world) ? &quot;UTF-8 ON\n&quot; : &quot;UTF-8 OFF\n&quot;;
&gt; 
&gt; # &quot;apples&quot; in german
&gt; my $apples = &#039;äpfel&#039;;
&gt; print utf8::is_utf8($apples) ? &quot;UTF-8 ON\n&quot; : &quot;UTF-8 OFF\n&quot;;
&gt; 
&gt; my %hash = (
&gt;     foo      =&gt; 1,
&gt;     &#039;bar&#039;    =&gt; 1,
&gt;     äpfel    =&gt; 1,
&gt;     &#039;häuser&#039; =&gt; 1, # &quot;Houses&quot; in german
&gt; );
&gt; 
&gt; while ( my ($key, $value) = each %hash ) {
&gt;     print &quot;Key ($key) has &quot;, utf8::is_utf8($key) ? &#039;UTF-8 ON&#039; : &#039;UTF-8 OFF&#039;, &quot;\n&quot;;
&gt; }

Output is:
&gt; UTF-8 OFF
&gt; UTF-8 ON
&gt; Key (bar) has UTF-8 OFF
&gt; Key (häuser) has UTF-8 ON
&gt; Key (foo) has UTF-8 ON
&gt; Key (äpfel) has UTF-8 ON</description>
		<content:encoded><![CDATA[<p>Here is another bit of code with UTF-8 Handling in Perl. The important part of the &#8220;utf8&#8243; documentation is:</p>
<p>&gt; &#8220;Bytes in the source text that have their high-bit set will be treated as being part of a literal UTF-X sequence.&#8221;</p>
<p>&gt; #!/usr/bin/env perl<br />
&gt; # Core Module<br />
&gt; use strict;<br />
&gt; use warnings;<br />
&gt; use utf8;<br />
&gt; # If you print string out to (file)handles that has UTF-8 Flag on,<br />
&gt; # perl does automatically encode everything to &#8220;ISO-8859-1&#8243;<br />
&gt; # is also does this with STD*  With this line of code we say that<br />
&gt; # &#8220;all&#8221; handles should encode everything to UTF-8<br />
&gt; use open &#8216;:encoding(UTF-8)&#8217;;<br />
&gt; # But &#8220;all&#8221; is a lie, it does this not with the &#8220;STD*&#8221; Handles<br />
&gt; # With this line we say that the STD* handles gets the same threatment.<br />
&gt; # You need this if your terminal is already (UTF-8) (today any Linux<br />
&gt; # Distribution should have this)<br />
&gt; use open &#8216;:std&#8217;;<br />
&gt;<br />
&gt; # &#8220;Hello, World!&#8221; in german<br />
&gt; my $world = &#8216;Hallo, Welt!&#8217;;<br />
&gt; print utf8::is_utf8($world) ? &#8220;UTF-8 ON\n&#8221; : &#8220;UTF-8 OFF\n&#8221;;<br />
&gt;<br />
&gt; # &#8220;apples&#8221; in german<br />
&gt; my $apples = &#8216;äpfel&#8217;;<br />
&gt; print utf8::is_utf8($apples) ? &#8220;UTF-8 ON\n&#8221; : &#8220;UTF-8 OFF\n&#8221;;<br />
&gt;<br />
&gt; my %hash = (<br />
&gt;     foo      =&gt; 1,<br />
&gt;     &#8216;bar&#8217;    =&gt; 1,<br />
&gt;     äpfel    =&gt; 1,<br />
&gt;     &#8216;häuser&#8217; =&gt; 1, # &#8220;Houses&#8221; in german<br />
&gt; );<br />
&gt;<br />
&gt; while ( my ($key, $value) = each %hash ) {<br />
&gt;     print &#8220;Key ($key) has &#8220;, utf8::is_utf8($key) ? &#8216;UTF-8 ON&#8217; : &#8216;UTF-8 OFF&#8217;, &#8220;\n&#8221;;<br />
&gt; }</p>
<p>Output is:<br />
&gt; UTF-8 OFF<br />
&gt; UTF-8 ON<br />
&gt; Key (bar) has UTF-8 OFF<br />
&gt; Key (häuser) has UTF-8 ON<br />
&gt; Key (foo) has UTF-8 ON<br />
&gt; Key (äpfel) has UTF-8 ON</p>
]]></content:encoded>
	</item>
</channel>
</rss>

