0

My data is stored in firebird database. The actual data is "E…" but when queried in PHP it shows as "E�" How to get correct data?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Mohan C
  • 73
  • 1
  • 9
  • Does this answer your question? [PHP MySQL database strange characters](https://stackoverflow.com/questions/1910549/php-mysql-database-strange-characters) – Triby Jan 08 '20 at 18:44
  • 1
    @Triby That question applies to MySQL, so although the underlying problem is similar, the solutions will not be exactly the same. – Mark Rotteveel Jan 08 '20 at 18:45
  • 1
    The problem is probably that you are using connection character set NONE on a system which uses UTF-8 as the default character set, while the data is stored in a different character set (eg windows-1252). – Mark Rotteveel Jan 08 '20 at 18:46
  • The solution is having all your data sources using the same character set (php, html, database, etc.) – Triby Jan 08 '20 at 18:46
  • Please provide a [mre] that shows how you connect to Firebird and output the data, the DDL of the relevant tables would also be helpful, especially whether or not the database columns have an explicit character set or not. – Mark Rotteveel Jan 08 '20 at 18:48
  • @Triby - this is a quest in futility, given that different languages have different ideas what is proper character set inside and outside of application. Even the same application run on Windows and Linux might think different character sets are "native choice". The solution is **specifying** the character set in the connection properties and optionally in the text column declarations (if not, they would borrow those from the connection), so Firebird knows which way to interprete incoming text and which way to convert outcoming text. – Arioch 'The Jan 09 '20 at 08:34

0 Answers0