<?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>Sun, 07 Sep 2008 05:34:11 -0500</pubDate>
    <ttl>30</ttl>
    <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[Mark Kimsal's Blog: Addslashes(): don't call it a comeback]]></title>
      <guid>http://www.phpdeveloper.org/news/10401</guid>
      <link>http://www.phpdeveloper.org/news/10401</link>
      <description><![CDATA[<p>
As <i>Michael Kimsal</i> <a href="http://michaelkimsal.com/blog/php-addslashes-alternatives-comparison/">points out</a>, there's a <a href="http://cognifty.com/index.php/blog.entry/id=6/addslashes_dont_call_it_a_comeback.html">new posting</a> on his brother <i>Mark</i>'s blog talking about alternatives to addslashes() in your applications.
</p>
<blockquote>
I've seen a lot of people talking about mysql_real_escape_string() vs addslashes() vs addcslashes(). There seems to be a lot of real confusion about what these functions do (even with the php.net manual around), especially when it comes to character sets. [...] So, I've decided to lay it all out in a few charts so there is no confusion about what each function does and how each can help protect against SQL injection attacks.
</blockquote>
<p>
He <a href="http://cognifty.com/index.php/blog.entry/id=6/addslashes_dont_call_it_a_comeback.html">ran some tests</a> based on what the function does to see if it helps with certain things like "escapes with single quotes instead of backslash" and "prevents multi-byte attacks". He compares the speed and testability of the functions as well as provides a multi-byte breakdown oh how the mysql_real_escape_string function works with different character sets.
</p>]]></description>
      <pubDate>Thu, 12 Jun 2008 13:36:20 -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[Elizabeth Smith's Blog: String Class (Kal_String)]]></title>
      <guid>http://www.phpdeveloper.org/news/4772</guid>
      <link>http://www.phpdeveloper.org/news/4772</link>
      <description><![CDATA[On her blog today, <i>Elizabeth Smith</i> has <a href="http://elizabethmariesmith.com/2006/01/31/string-class/">this new post</a> highlighting a string class that she's created to overload the basic PHP types to handle multibyte or translated strings.
<p>
<quote>
<i>
So my rather cumbersome three classes to handle translation and charsets is now ONE class. When the rest of the magic __toString stuff goes into php (estimated for 5.2, which I wouldn't know if I didn't read internals religiously) it makes it even easier to use.
<p>
<a href="http://websvn.bluga.net/wsvn/Kalfu/trunk/kalfu/lib/string.class.php?op=file&rev=0&sc=0">Kal_String</a> is the class itself. Basically it has TWO constructors - because there are a series of static settings and two static methods that deal with things like a default charset to use for all strings and a default language to look for. The language searching is set up with a callback - so you can write your own class using gettext or including straight php files or whatever you want. You can even manually load in translation strings for individual string instances if you're so inclined.
</i>
</quote>
<p>
She <a href="http://elizabethmariesmith.com/2006/01/31/string-class/">gives examples</a> of how to use the class, everything from just a simple output to the use of some of the more advanced "interpretation"-based features.]]></description>
      <pubDate>Wed, 01 Feb 2006 06:48:47 -0600</pubDate>
    </item>
  </channel>
</rss>
