SQL return in PHP converts accent to '?'

Asked

Viewed 115 times

1

I have a problem with encounter, my return from the Bank Oracle is doing the accents in ? Could anyone help me? Detail need to convert into variable not only in Browser, because I will use for another select.

       $sqlIn = "SELECT  distinct(LOCALIDADE_NOME) , COUNT(LOCALIDADE_NOME) FROM TBL_TA
            INNER JOIN TBL_TA_EQUIPAMENTO ON CODIGO=AEQ_TA WHERE TQA_ORIGEM IN ($listaIn)
            GROUP BY LOCALIDADE_NOME";
    $RESP_QUERYa = oci_parse($SS, $sqlIn);
    oci_execute($RESP_QUERYa);
    $afetacaolista = new ArrayObject();
    while (($row = oci_fetch_array($RESP_QUERYa, OCI_BOTH)) != false) {
        $afetacao = new afetacaoBean();
        echo $teste = utf8_encode($row['LOCALIDADE_NOME']) . "<br>";
        }

The Exit is:

RIBEIR?O PIRES 
VARZEA PAULISTA 
FRANCO DA ROCHA 
S?O PAULO 
JUNDIAI 
FRANCISCO MORATO 

I’ve tried a lot of things like :

    mb_internal_encoding("UTF-8");
    mb_http_output("iso-8859-1");
    ob_start("mb_output_handler");
    header("Content-Type: text/html; charset=ISO-8859-1", true);

I have no way to change the configuration of the Database or Tables.

1 answer

1


From what I understand it may be the very encounter of the connection with Oracle. You can try to force encoding on the connection itself in this way:

$conn = oci_connect( $username, $pass, $conn_string, 'UTF8' );

Browser other questions tagged

You are not signed in. Login or sign up in order to post.