<?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>dotvoid.com &#187; i18n</title>
	<atom:link href="http://www.dotvoid.com/tag/i18n/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotvoid.com</link>
	<description>Experiments and thoughts in PHP and javascript</description>
	<lastBuildDate>Tue, 11 Oct 2011 12:49:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Detecting UTF BOM &#8211; byte order mark</title>
		<link>http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/</link>
		<comments>http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 08:43:20 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=447</guid>
		<description><![CDATA[When integrating systems with many different data sources and systems across Europe you are bound to eventually run in to issues with UTF-8 and national character sets as for example the Swedish ISO-8859-1. Even when parsing simple UTF-8 files with comma separated values things might things might popup to bite you.
One such thing is the [...]]]></description>
			<content:encoded><![CDATA[<p>When integrating systems with many different data sources and systems across Europe you are bound to eventually run in to issues with UTF-8 and national character sets as for example the Swedish ISO-8859-1. Even when parsing simple UTF-8 files with comma separated values things might things might popup to bite you.</p>
<p>One such thing is the occurrence of the UTF byte order mark, or BOM. The UTF-8 character for the byte order mark is U+FEFF, or rather three bytes &#8211; 0xef, 0xbb and 0xbf &#8211; that sits in the beginning of the text file. For UTF-16 it is used to indicate the byte order. For UTF-8 it is not really necessary.</p>
<p>But for UTF-8, especially on Windows, it has become more and more common to use it to indicate that the file is indeed UTF. Most text editors handle this well and you won&#8217;t ever see these bytes. As it should be.</p>
<p>The problems start when you are using PHP binary safe string functions such as strcmp() and substr(). Then these three bytes that won&#8217;t be visible even when using var_dump() can become bothersome. (<em>You would however see that the string length output by var_dump() is correct and also counts the invisible bytes.</em>)</p>
<p>So you need to detect the three bytes and remove the BOM. Below is a simplified example on how to detect and remove the three bytes.</p>
<pre>$str = file_get_contents('file.utf8.csv');
$bom = pack("CCC", 0xef, 0xbb, 0xbf);
if (0 == strncmp($str, $bom, 3)) {
	echo "BOM detected - file is UTF-8\n";
	$str = substr($str, 3);
}</pre>
<p>It&#8217;s as simple as that.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;title=Detecting+UTF+BOM+-+byte+order+mark" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;t=Detecting+UTF+BOM+-+byte+order+mark" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;title=Detecting+UTF+BOM+-+byte+order+mark&amp;summary=When%20integrating%20systems%20with%20many%20different%20data%20sources%20and%20systems%20across%20Europe%20you%20are%20bound%20to%20eventually%20run%20in%20to%20issues%20with%20UTF-8%20and%20national%20character%20sets%20as%20for%20example%20the%20Swedish%20ISO-8859-1.%20Even%20when%20parsing%20simple%20UTF-8%20files%20with%20comma%20separated%20values%20things%20might%20things%20might%20po&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/&amp;title=Detecting+UTF+BOM+-+byte+order+mark" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Detecting+UTF+BOM+-+byte+order+mark+-+http://b2l.me/rqfjk&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Zend Framework &#8211; file input labels are not translated</title>
		<link>http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/</link>
		<comments>http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/#comments</comments>
		<pubDate>Tue, 19 May 2009 15:20:30 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=374</guid>
		<description><![CDATA[I hade some time over and updated one of my own projects to Zend Framework 1.8.1. Apart from a change in the auto loader API everything went smooth. But I was a bit annoyed to find out that a simple translation bug still was unfixed. As my project is going live soon I need that [...]]]></description>
			<content:encoded><![CDATA[<p>I hade some time over and updated one of my own projects to <a href="http://framework.zend.com">Zend Framework</a> 1.8.1. Apart from a change in the auto loader API everything went smooth. But I was a bit annoyed to find out that a simple translation bug still was unfixed. As my project is going live soon I need that bit fixed.</p>
<p>The bug is known and open so I didn&#8217;t need to report it. I voted for the issue to be fixed, waited two minutes and still no fix&#8230; I thought that was how open source projects worked <img src='http://www.dotvoid.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Seriously though, I fixed the issue locally and added what I think should be a correct fix in the comments. (Even though I think it is weird that the transfer adapter should even have the remotest connection to translation logic.)</p>
<p><a href="http://framework.zend.com/issues/browse/ZF-6647">http://framework.zend.com/issues/browse/ZF-6647</a></p>
<p>Looking at the statistics for Zend Framework issues I think it is time to step back and slow down on implementing new features. The diff between new issues and resolved issues is constantly getting bigger and bigger while the average time to fix an issue is getting longer and longer. This is natural as the project constantly have grown since it&#8217;s birth. But as I like working with ZF I&#8217;d hate to see it become a big and unruly behemoth that adds more problems than solutions.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/&amp;title=Zend+Framework+-+file+input+labels+are+not+translated" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/&amp;t=Zend+Framework+-+file+input+labels+are+not+translated" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/&amp;title=Zend+Framework+-+file+input+labels+are+not+translated&amp;summary=I%20hade%20some%20time%20over%20and%20updated%20one%20of%20my%20own%20projects%20to%20Zend%20Framework%201.8.1.%20Apart%20from%20a%20change%20in%20the%20auto%20loader%20API%20everything%20went%20smooth.%20But%20I%20was%20a%20bit%20annoyed%20to%20find%20out%20that%20a%20simple%20translation%20bug%20still%20was%20unfixed.%20As%20my%20project%20is%20going%20live%20soon%20I%20need%20that%20bit%20fixed.%0D%0A%0D%0AThe%20bug&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/&amp;title=Zend+Framework+-+file+input+labels+are+not+translated" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Zend+Framework+-+file+input+labels+are+not+translated+-+http://b2l.me/wvq2r&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2009/05/zend-framework-file-input-labels-are-not-translated/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ye olde English is dead</title>
		<link>http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/</link>
		<comments>http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 08:34:06 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=361</guid>
		<description><![CDATA[There are probably as many solutions to creating SEO friendly urls as there are actual implementations. After real work yesterday I started looking at the rather simple method based on the PHP built in strtr() we use. It&#8217;s very simple and apart from some uppercase, lowercase and utf8 juggling the (very shortened) basis is something [...]]]></description>
			<content:encoded><![CDATA[<p>There are probably as many solutions to creating SEO friendly urls as there are actual implementations. After real work yesterday I started looking at the rather simple method based on the PHP built in <a href="http://www.php.net/strtr/">strtr()</a> we use. It&#8217;s very simple and apart from some uppercase, lowercase and utf8 juggling the (very shortened) basis is something like below.</p>
<pre>$isochars = "\xFC\xFD\xFF";
$asciichars = "uyy";
$urlfriendly = strtr($actual_string, $isochars, $asciichars);</pre>
<p>What struck me was that the character þ (FE in hex) was translated into y. As is correct if you look at how y, in different forms, was used as an abbreviation for <em>the</em>, <em>that</em> and so on in old English &#8211; or Anglo-Saxon. Often it is now written &#8220;<em>Ye</em>&#8221; as in the blog post title. (Yes &#8211; the &#8220;<em>Y</em>&#8221; in the title should be pronounced as &#8220;<em>th</em>&#8220;.</p>
<p>However, it is a bit odd as the Icelandic language still use the letter frequently. The sound value is more or less the equivalent of the English &#8220;<em>th</em>&#8221; in <em>this</em> or <em>the</em>.</p>
<p>The major value in SEO friendly urls is the readability. Shouldn&#8217;t it be more friendly and natural to translate þ into &#8220;th&#8221; in SEO friendly urls then?</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/&amp;title=Ye+olde+English+is+dead" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/&amp;t=Ye+olde+English+is+dead" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/&amp;title=Ye+olde+English+is+dead&amp;summary=There%20are%20probably%20as%20many%20solutions%20to%20creating%20SEO%20friendly%20urls%20as%20there%20are%20actual%20implementations.%20After%20real%20work%20yesterday%20I%20started%20looking%20at%20the%20rather%20simple%20method%20based%20on%20the%20PHP%20built%20in%20strtr%28%29%20we%20use.%20It%27s%20very%20simple%20and%20apart%20from%20some%20uppercase%2C%20lowercase%20and%20utf8%20juggling%20the%20%28v&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/&amp;title=Ye+olde+English+is+dead" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Ye+olde+English+is+dead+-+File: /data/app/webapp/functions.php<br />Line: 66<br />Message: Duplicate entry 'wt3fb' for key 'code'&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2009/03/ye-olde-english-is-dead/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

