<?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>Displayobject &#187; Php</title>
	<atom:link href="http://www.displayobject.fr/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.displayobject.fr</link>
	<description>Back to the display list</description>
	<lastBuildDate>Mon, 09 Jan 2012 13:26:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Test Operation with Flash Builder and Zend AMF on mysql utf8 database</title>
		<link>http://www.displayobject.fr/2010/06/10/test-operation-with-flash-builder-and-zend-amf-on-mysql-utf8-database/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=test-operation-with-flash-builder-and-zend-amf-on-mysql-utf8-database</link>
		<comments>http://www.displayobject.fr/2010/06/10/test-operation-with-flash-builder-and-zend-amf-on-mysql-utf8-database/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 11:44:06 +0000</pubDate>
		<dc:creator>Jonas</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[amf]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=505</guid>
		<description><![CDATA[The problem occurs when there are accented characters in an utf8 database (particularly common in french). The generated service works properly, but is not testable in Test Operation view.
Flash Builder displays an error advising to encode the content with the php method utf8_encode ()... <a href="http://www.displayobject.fr/2010/06/10/test-operation-with-flash-builder-and-zend-amf-on-mysql-utf8-database/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The problem occurs when there are accented characters in an utf8 database (particularly common in french).<br />
The generated service works properly, but cannot be tested in <em>Test Operation view</em>.<br />
Flash Builder displays an error advising to encode the content with the php method utf8_encode ()&#8230;<br />
<span id="more-505"></span><br />
<img src="http://www.displayobject.fr/wp-content/uploads/2010/06/flash-builder-zend-amf-utf8-error.png" alt="“InvocationTargetException:There was an error while invoking the operation. Check your operation inputs or server code and try invoking the operation again.<br />
Reason: An error occured while reading response sent by server. Try encoding the response suitably before sending it. e.g. If a database column contains UTF-8 characters then use utf8_encode() to encode its value before returning it from the operation." /></p>
<p>Oh ? Really ?<br />
After some test I remember what I always do before performing queries&#8230; And what is not in the Flash Builder generated service&#8230; Character set definition.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000088;">$stmt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysqli_prepare</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connection</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;SET NAMES UTF8;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">throwExceptionOnError</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mysqli_stmt_execute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$stmt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">throwExceptionOnError</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>To put in the constructor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2010/06/10/test-operation-with-flash-builder-and-zend-amf-on-mysql-utf8-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Afficher des chaines JSON valides dans le browser AMFPHP 1.9</title>
		<link>http://www.displayobject.fr/2009/08/28/afficher-des-chaines-json-valides-dans-le-browser-amfphp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=afficher-des-chaines-json-valides-dans-le-browser-amfphp</link>
		<comments>http://www.displayobject.fr/2009/08/28/afficher-des-chaines-json-valides-dans-le-browser-amfphp/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 23:22:16 +0000</pubDate>
		<dc:creator>Jonas</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[amfphp]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[remoting]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=72</guid>
		<description><![CDATA[Un peu frustré à l’idée de ne pouvoir afficher de chaine JSON valides dans le browser, j’ai jeté un coup d’oeil dans la classe php utilisée pour récupérer les services. Après investigation le « problème » se situe dans la classe core/shared/util/MethodTable.php. <a href="http://www.displayobject.fr/2009/08/28/afficher-des-chaines-json-valides-dans-le-browser-amfphp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Un peu frustré à l&#8217;idée de ne pouvoir afficher de chaine JSON valides dans le browser, j&#8217;ai jeté un coup d&#8217;oeil dans la classe php utilisée pour récupérer les services. Après investigation le &#8220;problème&#8221; se situe dans la classe core/shared/util/MethodTable.php.</p>
<p>Pour pouvoir entrer des emails :</p>
<p>lignes 381 :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> MethodTable<span style="color: #339933;">::</span><span style="color: #004000;">cleanComment</span><span style="color: #009900;">&#40;</span>strrstr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;@&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>devient :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> MethodTable<span style="color: #339933;">::</span><span style="color: #004000;">cleanComment</span><span style="color: #009900;">&#40;</span>strrstr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;* @&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Pour ne pas échapper les doubles quotes :</p>
<p>ligne 511 :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>devient :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//$comment = str_replace(&quot;\&quot;&quot;, &quot;\\\&quot;&quot;, $comment);</span></pre></div></div>

<p>Sinon, à quand la 2.0 ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2009/08/28/afficher-des-chaines-json-valides-dans-le-browser-amfphp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

