0

Im trying to print some values from a sybase database on a php table but when i print them i got some problems with special characters like 'ç', or 'Ô'since they print symbols instead of them.

I tried to get their encode type with mb_detect_encoding() and it returned the 'ASCII' encode. Then, i tried to use chr() and it didnt print anything.Then, i tried to use iconv('ASCII', 'UTF-8', $row['Descricao']) and it gets me the error of 'detected illegal file in line xx', after that i tried the 'UTF-8//IGNORE' and it justs deletes the charecter printing the other ones.

Im just trying to print a simple value, this is the code: <?= iconv('ASCII', 'UTF-8', $row['Descricao'])?>

I've read several posts but i could'nt find an answer that prints me all the characters (including the special ones).

Can anyone help me?

Marco Silva
  • 191
  • 1
  • 11
  • See https://stackoverflow.com/questions/279170/utf-8-all-the-way-through it may help – RiggsFolly Mar 28 '19 at 11:04
  • You need to set the character encoding or "charset" for the DB connection. What do you use, PDO or the old deprecated sybase extension? – Joni Mar 28 '19 at 11:33
  • im using odbc to connect to the sybase db, my boss said that i couldnt change db settings :/ – Marco Silva Mar 28 '19 at 11:35

0 Answers0