Reputation: 5290
I'm using CodeIgniter with the MSSQL driver ($db['default']['dbdriver']
).
I'm connecting to a remote database. In the hostname i have the IP of the server.
The database collation is SQL_Latin1_General_CP1_CI_AS
.
The problem is that when I fetch the data, the Hebrew shows as question marks. I tried various combinations of charsets, iconv and mb conversions, but none seems to work.
I would think it's something in the connection string, but using the MSSQL driver there's not connection string. When I tried it with the ODBC driver it worked properly (the setup for the ODBC worked from my local machine but not from the server, which has the MSSQL extension installed, hence I'm using the MSSQL driver).
Any help will be appreciated.
I've switched to PDO and now sometimes I get:
Fatal error: Cannot access property started with '\0' in /var/www/clients/client1/web2/web/cliqa/ci/system/database/drivers/pdo/pdo_result.php on line 176
I supposed it happens when the connection fails. Sometimes it shows properly (but with question marks) and sometimes I get this error.
Upvotes: 1
Views: 1974
Reputation: 5290
SOLUTION:
It was solved by a friend, and it had to do something with the configuration of the server:
cat /etc/freetds.conf
create a new instance
[annoyingRemoteHostSrv]
host = IP_ADDRESS
port = 1433
tds version = 8.0
client charset = UTF-8
hope it helps anyone ;)
Upvotes: 1
Reputation: 2427
Use Unicode data types if possible - nvarchar
. So server collation doesn't affect your data regardless of source codepage.
Upvotes: 0