Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy do I get a different result using the same data?
    text
    copied!<p>While moving my websites to a new server, a found the following issue: the rendering of 'strange' characters (ê,ç,ã,etc) coming from mysql are being rendered wrong.</p> <p>For example:</p> <p>MySQL: Galo vai a final, após cobranças de pênaltis.</p> <p><strong>Old server (apache 2.2 /php 5.3):</strong> Galo vai a final, após cobranças de pênaltis. (Correct)</p> <p><strong>New server (apache 2.4 /php 5.4):</strong> Galo vai a final, após cobranças de pênaltis. (Wrong)</p> <p>I belive that either apache or php is causing this but I haven't found documentantion about it anywhere.</p> <p>Can someone help me to find the cause for this error?</p> <p><strong>EDIT</strong></p> <p>Here's the code to render this (note that it's the same in both servers):</p> <p>Controller:</p> <pre><code>//Noticias $q = Doctrine_Query::create() -&gt;select("id,titulo,thumb,conteudo") -&gt;from('noticia') -&gt;limit(10) -&gt;where("data &lt;= '$today'") -&gt;andWhere("status = 1") -&gt;andWhere("categoria_id = 1") -&gt;orderby('data DESC'); $res = $q-&gt;fetchArray(); foreach($res as $key =&gt; $value){ $res[$key]['titulo'] = stripslashes($res[$key]['titulo']); $res[$key]['conteudo'] = strip_tags($res[$key]['conteudo']); $res[$key]['conteudo'] = stripslashes($res[$key]['conteudo']); $res[$key]['conteudo'] = substr($res[$key]['conteudo'],0,150) . '...'; } $smarty -&gt; assign('noticias',$res); </code></pre> <p>View:</p> <pre><code>&lt;ul class="homelist"&gt; {foreach item=noticia from=$noticias name=news} &lt;li&gt; &lt;a href="noticia/{$noticia.id}/{$noticia.titulo|slug}/"&gt;&lt;img src="assets/images/noticias/{$noticia.thumb}" alt="" /&gt;&lt;/a&gt; &lt;a class="title" href="noticia/{$noticia.id}/{$noticia.titulo|slug}/"&gt;{$noticia.titulo}&lt;/a&gt; &lt;p&gt;{$noticia.conteudo}&lt;/p&gt; &lt;a class="more" href="noticia/{$noticia.id}/{$noticia.titulo|slug}/"&gt;more&lt;/a&gt; &lt;/li&gt; {/foreach} &lt;li&gt;&lt;p align="center"&gt;&lt;a href="/noticias/1"&gt;Veja mais&lt;/a&gt;&lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload