0

I am little trouble in my work. I am working on sql server database and I have access only for fetching data from views.

Now, the database contains some information in other language like Ukrainian. So, when I am fetching data using select query and print it on browser then it is showing me question mark (??) instead of actual data.

My query is given below:
select * from view1;

And the output is something like below:

enter image description here

Please look at the question mark.

Previously I was using the sqlsrv_connect() function to connect with sql server database and this function allows you to set character set (UTF-8) for your work. But the client server is on linux, I have to use mssql_connect() and this function doesn't have any option to set character set.

When I was setting the character set as "UTF-8" then, select query was showing actual data. But, I will do in case of mssql_connect() function.

Is there any collation set to handle this kind of situation? or any other way to change the character set before executing select statement.

Please help me on this issue. I am really frustated. Thanks in Advance

Dhirender
  • 604
  • 8
  • 23
  • are you sure that the data is saved as Unicode correctly into some Unicode-data column? I doubt that the data is actually corrupted due to saving, so achieving it will always return corrupted string. – King King Nov 17 '17 at 09:00

1 Answers1

-1

Try to set your database and table collation to utf8_general_ci. I used that and it displays almost all different kind of languages in my table. But it depends on how much letters and symbols utf8 supports.

Muhammad Habib
  • 99
  • 2
  • 13
  • I can't alter the database as well as table collation. I am only allow to fetching data from views. – Dhirender Nov 17 '17 at 03:51
  • if you cannot alter the database, then you will not manage to display the data because the data is already encoded within the database due to the database collation itself. But anyhow, you can just wait for another answer. Someone might have worked on this =) – Muhammad Habib Nov 17 '17 at 03:56