<?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>Jefim Borissov &#187; encoding</title>
	<atom:link href="http://jefim.eu/blog/tag/encoding/feed/" rel="self" type="application/rss+xml" />
	<link>http://jefim.eu/blog</link>
	<description>Житие мое</description>
	<lastBuildDate>Fri, 05 Aug 2011 22:28:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>CodeIgniter &#8211; Cart crap with Cyrillic characters</title>
		<link>http://jefim.eu/blog/2009/12/codeigniter-cart-crap-with-cyrillic-characters/</link>
		<comments>http://jefim.eu/blog/2009/12/codeigniter-cart-crap-with-cyrillic-characters/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 02:51:00 +0000</pubDate>
		<dc:creator>Jefim</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cart]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[encoding]]></category>

		<guid isPermaLink="false">http://jefim.eu/blog/?p=280</guid>
		<description><![CDATA[Ok, now this is so ridiculous that I have to blog about this even though I do not want to. CodeIgniter just blew my mind some time ago when I upgraded to 1.7.2 for the new Cart library. I realize, that it is a basic functionality, yet still... It does not support cyrillic characters in [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, now this is so ridiculous that I have to blog about this even though I do not want to. CodeIgniter just blew my mind some time ago when I upgraded to 1.7.2 for the new Cart library. I realize, that it is a basic functionality, yet still... <strong>It does not support cyrillic characters in the product name!</strong> It is freaking 2009, almost 2010 and one of the most popular MVC frameworks does not support cyrillic? And I bet any other "strange" characters too, because basically they have a filter there with a regexp:</p>
<pre class="php" name="code">var $product_name_rules	= '\.\:\-_ a-z0-9';</pre>
<p>Now that is some serious shit! <img src='http://jefim.eu/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, if you have trouble with the same thing - doing non-latin chars in product names just find and comment out the following part from <em>system/libraries/Cart.php</em>:</p>
<pre class="php" name="code">if ( ! preg_match("/^[".$this-&gt;product_name_rules."]+$/i", $items['name']))
{
	log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces');
	return FALSE;
}</pre>
<p>Also, if you are using a database table for your sessions - do not forget to check that the user_data field uses UTF-8 as its encoding (otherwise it won't let cyr chars into the field).</p>
]]></content:encoded>
			<wfw:commentRss>http://jefim.eu/blog/2009/12/codeigniter-cart-crap-with-cyrillic-characters/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

