<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 20 Jun 2013 02:46:04 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Project: Patchwork-UTF8 - UTF8 Support for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17458</guid>
      <link>http://www.phpdeveloper.org/news/17458</link>
      <description><![CDATA[<p>
<i>Nicolas Grekas</i> has shared another tool that he's pulled out of his "Patchwork" framework to make it a stand-alone tool: the <a href="https://github.com/nicolas-grekas/Patchwork-UTF8">Patchwork-UTF8 helper</a> that provides matching functions to those PHP already has for regular strings, but a little smarter to work with UTF8 correctly.
</p>
<blockquote>
The PatchworkUtf8 class implements the quasi complete set of string functions that need UTF-8 grapheme clusters awareness. These functions are all static methods of the PatchworkUtf8 class. The best way to use them is to add a use PatchworkUtf8 as u; at the beginning of your files, then when UTF-8 awareness is required, prefix by u:: when calling them.
</blockquote>
<p>
In <a href="https://github.com/nicolas-grekas/Patchwork-UTF8/blob/master/README.md">the README</a> for the tool he talks about the functions included in the current release that match PHP's string functions as well as some additional methods like "isUtf8", "bestFit" and "strtocasefold". It relies on the mbstring, iconv and intl extensions being installed, and if they aren't, it falls back to other functionality (list of those methods included).
</p>]]></description>
      <pubDate>Fri, 27 Jan 2012 11:38:40 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Yannick's Blog: mbstring vs iconv benchmarking]]></title>
      <guid>http://www.phpdeveloper.org/news/11153</guid>
      <link>http://www.phpdeveloper.org/news/11153</link>
      <description><![CDATA[<p>
Recently on his blog <i>Yannick</i> has done some benchmarking <a href="http://dokeoslead.wordpress.com/2008/10/05/mbstring-vs-iconv-benchmarking/">comparing mbstring and iconv</a> in PHP 5.2.4 release.
</p>
<blockquote>
Following up on <a href="http://dokeoslead.wordpress.com/2008/04/22/mbstring-vs-iconv/">my previous post</a> about the differences between the mbstring and iconv international characters libraries (which resulted in a tentative conclusion that nobody knew anything about those differences), and particularly the comments by <a href="http://www.entidi.it/">Nicola</a>, we have combined forces (mostly efforts from Nicola, actually) to provide you with a little benchmarking, if that can help you decide.
</blockquote>
<p>
His code for the test script is included (for you to gather your own results) and a full listing of his results comparing the effects of possible caching, running up to ten executions. You can download the text file that he ran the script on <a href="http://mirror3.mirrors.tds.net/pub/gutenberg.org/1/3/0/8/13083/13083-utf8.txt">here</a>.
</p>]]></description>
      <pubDate>Mon, 06 Oct 2008 12:50:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Vinu Thomas' Blog: mbstring Functions by default in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10631</guid>
      <link>http://www.phpdeveloper.org/news/10631</link>
      <description><![CDATA[<p>
In a <a href="http://blogs.vinuthomas.com/2008/07/18/mbstring-functions-by-default-in-php/">new post</a> to his blog, <i>Vinu Thomas</i> talks about a set of functions that can make your life easier when handling unicode strings - the <a href="http://php.net/manual/en/ref.mbstring.php">mb_* methods</a> of the mbstring extension.
</p>
<blockquote>
When dealing with multiple languages and internalization in PHP, some of the default functions in PHP end up mangling up the unicode characters in PHP. This is evident when you have a lot of funny looking characters coming up on your web page instead of the actual characters. [...] There is an extensions called mbstring which you can install in PHP which gives you a set of functions which are unicode ( actually multibyte ) ready.
</blockquote>
<p>
He mentions some of the replacements like mb_send_mail instead o fmail and mb_strlen instead of the usual strlen. Thankfully, there's a simple way to make use of these functions without having to replace a lot of code - a setting in your php.ini (mbstring.func_overload) that tells your application to seamlessly replace things behind the scenes.
</p>]]></description>
      <pubDate>Fri, 18 Jul 2008 07:57:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Dokeos Blog: mbstring vs iconv]]></title>
      <guid>http://www.phpdeveloper.org/news/10034</guid>
      <link>http://www.phpdeveloper.org/news/10034</link>
      <description><![CDATA[<p>
In <a href="http://dokeoslead.wordpress.com/2008/04/22/mbstring-vs-iconv/">this post</a> on the Dokeos blog, there's a comparison of the <a href="http://www.php.net/mbstring">mbstring</a> function and the <a href="http://php.net/iconv">iconv</a> library as it pertains to their use on multi-byte strings.
</p>
<blockquote>
I was wondering today why use mbstring rather than iconv in Dokeos, and honestly I didn't remember exactly why I had chosen mbstring in the past, but finding information about the *differences* between the two. [...] Searching a bit more, I found a <a href="http://www.nyphp.org/content/presentations/smallworld/April2006-nyphp-Presentation.ppt">PPT presentation</a> from Carlos Hoyos on Google.
</blockquote>
<p>
Essentially, it boils down to how the library is integrated - mbstring is bundled and iconv is pulled from an external source. So, if you're looking for maximum portability, he recommends mbstring.
</p>]]></description>
      <pubDate>Thu, 24 Apr 2008 11:18:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Alessandro Crugnola's Blog: AMFPHP and mbstring]]></title>
      <guid>http://www.phpdeveloper.org/news/8825</guid>
      <link>http://www.phpdeveloper.org/news/8825</link>
      <description><![CDATA[<p>
<i>Alessandro Crugnola</i> was <a href="http://www.sephiroth.it/weblog/archives/2007/10/amfphp_and_mbstring.php">struggling with an application</a> he was developing (with Flex and PHP) where his local PHP installation worked just fine but his remote system errored on the same code:
</p>
<blockquote>
Connecting to the service browser I was receiving the error "Channel.Ping.Failed" error and investingating a bit more in the fault message I discovered that the source error was: "The class {Amf3Broker} could not be found under the class path {/var/htdocs/amfphp/services/amfphp/Amf3Broker.php}" and the Amf3Broker php class does not exists anywhere in amfphp!
</blockquote>
<p>
Despite some default settings he found, though, things still weren't loading correctly. Finally, he found the culprit - <a href="http://www.php.net/mbstring">mbstring</a>. One server had the setting to overload the strings and the other didn't resulting in the return of corrupted data from the amfphp stream.
</p>]]></description>
      <pubDate>Fri, 12 Oct 2007 09:23:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Hot PHP UTF-8 tips]]></title>
      <guid>http://www.phpdeveloper.org/news/6005</guid>
      <link>http://www.phpdeveloper.org/news/6005</link>
      <description><![CDATA[<p>
Following up on some of his previous posts to the SitePoint PHP Blog, <i>Harry Fuecks</i> has posted <a href="http://www.sitepoint.com/blogs/2006/08/10/hot-php-utf-8-tips/">this quick guide</a> with some "hot UTF-8 tips" to share with the community.
</p>
<blockquote>
As a result of all the <a href="http://www.sitepoint.com/blogs/2006/08/09/scripters-utf-8-survival-guide-slides/">noise about UTF-8</a>, got an email from Marek Gayer with some very smart tips on handling UTF-8. What follows is a discussion illustrating what happens when you get obsessed with performance and optimizations (be warned - may be boring, depending on your perspective).
</blockquote>
<p>
He <a href="http://www.sitepoint.com/blogs/2006/08/10/hot-php-utf-8-tips/">talks mainly</a> about using the native PHP functionality to avoid the mbstring issues that could arise by restricting locale behavior and using a fast case conversion function to handle strings correctly. The other tip involves delivery methods to those not able to recieve UTF-8 formatted content - checking their character set and responding accordingly.
</p>]]></description>
      <pubDate>Thu, 10 Aug 2006 14:50:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney's Blog: mbstring comes to the rescue]]></title>
      <guid>http://www.phpdeveloper.org/news/5380</guid>
      <link>http://www.phpdeveloper.org/news/5380</link>
      <description><![CDATA[<p>
Character encodings, especially when dealing with XML, in PHP can be a pain to say the least. <i>Matthew Weir O'Phinney</i> <a href="http://weierophinney.net/matthew/archives/111-mbstring-comes-to-the-rescue.html">found this out first-hand</a> when a script he was working with had a mixed character set in one of its strings, giving the XML parser in the SimpleXML functionality problems.
</p>
<quote>
<i>
<p>
I tried a number of solutions, hoping actually to automate it via mbstring INI settings; these schemes all failed. iconv didn't work properly. The only thing that did work was to convert the encoding to latin1 -- but this wreaked havoc with actual UTF-8 characters.
</p>
<p>
Then, through a series of trial-and-error, all-or-nothing shots, I stumbled on a simple solution.
</p>
</i>
</quote>
<p>
The discovery was to detect the encoding of the string itself (not really the content) and convert eveything in it to that encoding. How, you might ask? With the handy mb_detect_encoding and mb_convert_encoding functions. Of course, this functionality has to be compiled into PHP, but it's well worth it if it's exactly what you need.
</p>]]></description>
      <pubDate>Wed, 17 May 2006 05:49:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: PHP UTF-8 0.1]]></title>
      <guid>http://www.phpdeveloper.org/news/4912</guid>
      <link>http://www.phpdeveloper.org/news/4912</link>
      <description><![CDATA[In <a href="http://www.sitepoint.com/blogs/2006/02/26/php-utf-8-01/">this post</a> from the SitePoint PHP Blog, <i>Harry Fuecks</i> talks about a new package of software he's worked up to make it possible for PHP to handle UTF-8 encoded strings - <a href="http://sourceforge.net/projects/phputf8">PHP UTF-8</a>.
<p>
<quote>
<i>
Been messing around with bits of this code for a long time, in fact since first really getting to grips with <a href="http://wiki.splitbrain.org/">Dokuwiki</a>, but finally got the <a href="http://prdownloads.sourceforge.net/phputf8/utf8-0.1.tar.gz?download">first release</a> out.
<p>
<a href="http://sourceforge.net/projects/phputf8">PHP UTF-8</a> is intended to make it possible to handle UTF-8 encoded strings in PHP, without requiring the mbstring extension (although it uses <a href="http://www.php.net/mbstring">mbstring</a> if it's available). In short, it provides versions of PHP's string functions (pretty much everything you'll find on <a href="http://www.phpwact.org/php/i18n/utf-8">this list</a>), prefixed with utf_ and aware of UTF-8 encoding (that 1character >= 1 byte). It also gives you some tools to help check UTF-8 strings for "well formedness", strip bad sequences and some "ASCII helpers".
</i>
</quote>
<p>
He <a href="http://www.sitepoint.com/blogs/2006/02/26/php-utf-8-01/">continues the post</a>, mentioning where some of the code for it was pulled from and a note about the documentation (there, but scarce). He also includes a warning for the use of it - not to use it "blindly" and only to use it when you need it, not to replace the standard PHP str_* functions.]]></description>
      <pubDate>Tue, 28 Feb 2006 06:54:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Living Dangerously with PHP and UTF-8]]></title>
      <guid>http://www.phpdeveloper.org/news/4457</guid>
      <link>http://www.phpdeveloper.org/news/4457</link>
      <description><![CDATA[In <a href="http://www.sitepoint.com/blogs/2005/12/06/living-dangerously-with-php-and-utf-8/">this new post</a> on the SitePoint PHP Blog today, <i>Harry</i> looks at why it's "living dangerously" to use PHP with UTF-8.
<p>
<quote>
<i>
Quick one'"knocked up a list of "dangerous" functions and functionality in PHP, in relation to the use of UTF-8, available at <a href="http://www.phpwact.org/php/i18n/utf-8">http://www.phpwact.org/php/i18n/utf-8</a>. These are for a "default" PHP setup without the <a href="http://www.php.net/mbstring">mbstring</a> overloading or PHP6 (where charset problems "magically vanish" ;) ).
<p>
This follows on from (unfinished) stuff <a href="http://www.phpwact.org/php/i18n/charsets">here on charsets (tending towards UTF-8)</a>, which should help explain some of this.
</i>
</quote>
<p>
He <a href="http://www.sitepoint.com/blogs/2005/12/06/living-dangerously-with-php-and-utf-8/">also notes</a> that you can't rely on mbstring to be there, so he <a href="http://phplens.com/phpeverywhere/?q=node/view/98">offers an alternative</a>...]]></description>
      <pubDate>Wed, 07 Dec 2005 07:45:38 -0600</pubDate>
    </item>
  </channel>
</rss>
