I have a database PHP application that can work with MySQL, PostgreSQL and SQLite. The application uses PDO and assumes the database content is Unicode.
I am adding the support for MS SQL SERVER using the pdo_sqlsrv driver and the only solution I have found is to modify all the queries (it's really a lot of work) adding the N prefix in front of the strings for the INSERT and UPDATE queries.
Is there any smarter solution to insert unicode by default? Like a PDO or SQL SERVER setting?
Since all the queries are executed by a function (it's my own layer over PDO), I have also thought about adding a regular expression that modifies the queries before the execution but I think it's quite tricky.
Thanks.