<?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>Mon, 21 May 2012 10:25:37 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Reddit.com: Let's talk Character Encoding]]></title>
      <guid>http://www.phpdeveloper.org/news/17680</guid>
      <link>http://www.phpdeveloper.org/news/17680</link>
      <description><![CDATA[<p>
On Reddit.com there's <a href="http://www.reddit.com/r/PHP/comments/qxacr/rphp_lets_talk_character_encoding/">a recent post</a> with a growing discussion about character encodings in PHP applications (with some various recommendations).
</p>
<blockquote>
I would rather not have to convert these weird characters to the HTML character entities, if possible. I'd rather be able to use these characters directly on the web page. If this is for some reason a bad idea, let me know. This might be more of a general web design question (i already posted it there), but I figured it is still appropriate to post here as well since PHP is used to pull an entry from the database, and I figured a lot of you here would know the answer to the question. 
</blockquote>
<p>
The general consensus is to use UTF8 in this case, but there's a few reminders for the poster too:
</p>
<ul>
<li>Don't forget to make the database UTF8 too
<li>Be sure you're sending the right Content-Type for the UTF8 data
<li>an <a href="http://www.joelonsoftware.com/articles/Unicode.html">link to an article</a> about what "developers must know about unicode/charactersets"
</ul>]]></description>
      <pubDate>Thu, 15 Mar 2012 11:07:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[James Cohen's Blog: How to Avoid Character Encoding Problems in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16246</guid>
      <link>http://www.phpdeveloper.org/news/16246</link>
      <description><![CDATA[<p>
<i>James Cohen</i> has a recent post to his blog looking at a way you can <a href="http://webmonkeyuk.wordpress.com/2011/04/23/how-to-avoid-character-encoding-problems-in-php/">avoid some of the character encoding problems</a> in PHP that can come with working with multiple character sets.
</p>
<blockquote>
Character sets can be confusing at the best of times. This post aims to explain the potential problems and suggest solutions. Although this is applied to PHP and a typical LAMP stack you can apply the same principles to any multi-tier stack.
</blockquote>
<p>
He includes a "boring history" session (and recommends skipping if you just want the good stuff) that talks a bit about character sets and their history in computer system handling. All that said, he recommends using UTF-8 to ease your character encoding woes. He talks about configuring your editor to support it, making sure your browsers understand it and setting up your MySQL database connection to use it.
</p>]]></description>
      <pubDate>Mon, 25 Apr 2011 14:13:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[WebReference.com: Create a Localized Web Page with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15318</guid>
      <link>http://www.phpdeveloper.org/news/15318</link>
      <description><![CDATA[<p>
On WebReference.com there's <a href="http://www.webreference.com/programming/php/localization/">a new tutorial posted</a> about localizing your website by defining a character set to use for your content.
</p>
<blockquote>
The process of making your applications/websites usable in many different locales is called internationalization, While customizing your code for different locales is called localization. Localization is the process of making your applications or websites local to where it is being viewed. For example, you can make a website more local to a particular place by converting its text to the predominate language of that location and by displaying the local time (e.g. German for people living in Germany or French for people living in France).
</blockquote>
<p>
They show how to define constants that can be used in your application for the character set and language encoding. They use two major encodings - UTF-8 and ISO-8859-1 - in their examples of showing a sample "welcome" message in different languages. There's also a simple page to show you how to switch between languages if you'd like to give your visitors the option.
</p>]]></description>
      <pubDate>Thu, 21 Oct 2010 13:21:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: You want to do WHAT with PHP? Chapter 3]]></title>
      <guid>http://www.phpdeveloper.org/news/15052</guid>
      <link>http://www.phpdeveloper.org/news/15052</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has posted another excerpt from his "You Want to Do WHAT with PHP?" book to his blog today. This time it's from <a href="http://www.eschrade.com/page/want-what-with-chapter-4c7bc5f5">the third chapter</a> that looks at character encodings like UTF-8 or ISO-8859-1.
</p>
<blockquote>
I realized that while this 3.5-year PHP consultant knew Unicode, UTF-8, character encodings such as ISO-8859-1 or ISO-8859-7, I didn't understand them as well as I thought I had.  With that I threw this chapter in the book.  Knowing about character encoding is what many developers have.  Not as many truly understand it.  In this chapter I try to de-mystify character encoding as a whole.
</blockquote>
<p>
The excerpt introduces character encoding and what it really is - a translation for the computer to be able to handle the human language. The problem comes in when multiple tools try to define the same sort of letters/chatacters in different ways. He gives an example of a "hello world" string in a normal ASCII format versus one from the EBCDIC format and how it would be rendered by an ASCII-understanding browser.
</p>]]></description>
      <pubDate>Tue, 31 Aug 2010 13:44:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Alan Skorkin's Blog: What Every Developer Should Know About URLs]]></title>
      <guid>http://www.phpdeveloper.org/news/14457</guid>
      <link>http://www.phpdeveloper.org/news/14457</link>
      <description><![CDATA[<p>
Sometimes getting back to the basics is a good thing. <i>Alan Skorkin</i> has done just that in his latest post looking at the <a href="http://www.skorks.com/2010/05/what-every-developer-should-know-about-urls/">basics of URLs</a> including their structure and what characters are allowed (or are special).
</p>
<blockquote>
Several people made a valid point in response to that post [about <a href="http://www.skorks.com/2010/04/on-the-value-of-fundamentals-in-software-development/">fundamentals in software development</a>], in that it is often difficult to know what the fundamentals actually are (be they macro or micro level). So, I thought it would be a good idea to do an ongoing series of posts on some of the things that I consider to be fundamental - this post is the first installment.
</blockquote>
<p>
He defines the structure of a URL (the scheme, host, port, etc), reserved characters and absolute versus relative URLs and how they're usually used.
</p>]]></description>
      <pubDate>Tue, 04 May 2010 11:08:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Alan Skorkin's Blog: How To Fix The WP-Syntax Special Character Escaping Issue]]></title>
      <guid>http://www.phpdeveloper.org/news/14167</guid>
      <link>http://www.phpdeveloper.org/news/14167</link>
      <description><![CDATA[<p>
<i>Alan Skorkin</i> has a recent post to his blog about a trouble that many WordPress users have come across in working with their content and the <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a> plugin (for displaying code) - a special character escaping bug that escapes characters that don't need it.
</p>
<blockquote>
Suffice to say, [WP-Syntax] does the job fine except for one very annoying issue. Whenever you have any kind of special characters in your code (which you inevitably do e.g. <, >, & etc.), these always render as their escaped representations.
</blockquote>
<p>
It only happens with the WYSIWYG editor for writing content (which the tool's FAQ recommends turning off) but there's a better solution that <i>Alan</i> found - change a line of code in the plugin to use the <a href="http://php.net/htmlspecialchars_decode">htmlspecialchars_decode</a> function to rid your install of this pesky escaping bug.
</p>]]></description>
      <pubDate>Thu, 11 Mar 2010 09:15:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: Javscript's escape and encodeURI vs. PHP $_POST]]></title>
      <guid>http://www.phpdeveloper.org/news/13799</guid>
      <link>http://www.phpdeveloper.org/news/13799</link>
      <description><![CDATA[<p>
<i>Evert Pot</i> came across <a href="http://www.rooftopsolutions.nl/article/261?">something strange</a> in an application he was working with - the incorrect decoding of data coming back from an Ajax call POSTed back into the app.
</p>
<blockquote>
Basically, data is coming into our PHP application through a Javascript's XMLHttpRequest (ajax). [...] Normally everything in the $_POST and $_GET arrays is already decoded, so when you're dealing with these arrays you don't really have to think about this. This time however, I was dealing with some non-latin unicode characters and for some reason they were never decoded and ended up in the database as raw url-encoded strings.
</blockquote>
<p>
The issue was caused by the fact that the non-latin characters were handled differently on the byte level and that, because of the choice PHP makes on which of the unicode characters to use for spaces, he found that there were two options for handling strings - escape() and encodeURI().
</p>]]></description>
      <pubDate>Thu, 07 Jan 2010 14:10:46 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: PHP DOM XML extension encoding processing]]></title>
      <guid>http://www.phpdeveloper.org/news/13149</guid>
      <link>http://www.phpdeveloper.org/news/13149</link>
      <description><![CDATA[<p>
On the Zend Developer Zone today <i>Alexander Veremyev</i> shares <a href="http://devzone.zend.com/article/8855-PHP-DOM-XML-extension-encoding-processing">some helpful hints</a> he discovered about the DOM XML extension for PHP that could come in handy when working with different character encodings.
</p>
<blockquote>
I recently worked with PHP's DOM XML extension while working on <a href="http://framework.zend.com/">Zend Framework</a>'s Zend_Search_Lucene HTML highlighting capabilities, and uncovered some undocumented features and issues with the extension in regards to character encoding. The information contained in this article should also apply to other libxml-based DOM implementations, as PHP's DOM extension simply wraps that library. 
</blockquote>
<p>There's five different tips he shares:</p>
<ul>
<li>Internal document encoding is always UTF-8
<li>Input data is always treated as UTF-8
<li>Text nodes and CDATA are stored as UTF-8 without transformations
<li>Document encoding does not affect loading behavior
<li>Save/dumping operations and encoding
</ul>
<p>
He describes each of the points and includes some sample code and XML to parse to help illustrate each.
</p>]]></description>
      <pubDate>Wed, 02 Sep 2009 09:48:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: The ABC's of PHP Part 5 - Strings & Text ]]></title>
      <guid>http://www.phpdeveloper.org/news/12355</guid>
      <link>http://www.phpdeveloper.org/news/12355</link>
      <description><![CDATA[<p>
PHPBuilder.com has <a href="http://www.phpbuilder.com/columns/peter_shaw04152009.php3">the latest in their series</a> looking at beginner level PHP and some of the core concepts that go with it ("The ABC's of PHP"). This latest tutorial looks at string and text handling.
</p>
<blockquote>
In the last part of this series we looked at what a variable was in general. Today we'll be covering strings and text. We'll look at the contents those variables would typically hold. 
</blockquote>
<p>
Topics include the differences between single and double quotes, appending to a string and special characters (like line feeds and tabs). Code snippets are provided for each to help you visualize what they mean.
</p>]]></description>
      <pubDate>Thu, 16 Apr 2009 09:31:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: UTF8, PHP and MySQL]]></title>
      <guid>http://www.phpdeveloper.org/news/12167</guid>
      <link>http://www.phpdeveloper.org/news/12167</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> <a href="http://akrabat.com/2009/03/18/utf8-php-and-mysql/">had a problem</a> - he needed to get the "pound" (as in the British monetary unit) into his MySQL database. His database didn't seem to want to comply:
</p>
<blockquote>
Everyone else probably already knows this stuff, but I hit an issue today to that took a while to sort out. Fortunately, some kind folks on IRC helped me, but as it's embarrassing to ask for help on the same issue twice, I'm writing down what I've learned! The problem: Get a &pound; character stored to MySQL, retrieved and then displayed without any weird characters in front of it using UTF8.
</blockquote>
<p>
His solution? Make sure you're using UTF-8 everywhere, not just when trying to insert into the database - in the broser's headers (both going in and coming out) and in the MySQL database insert. He gives code examples for each including database examples for PDO and the Zend_Db component of the <a href="http://framework.zend.com">Zend Framework</a>.
</p>]]></description>
      <pubDate>Thu, 19 Mar 2009 08:43:19 -0500</pubDate>
    </item>
  </channel>
</rss>

