PHP Problem with entering non-unicode characters into SQL Server


#1

Good evening,

When I try to enter Polish characters (like ę, ą, ó and so on) into SQL Server via PHP, I get “strange” characters insterted instead of correct ones. Column is NVARCHAR and collation is POLISH_CI_AS and both html (form) and php file are saved in UTF-8. Creating a statement INSERT INTO TableName VALUES (N’$value’); does not help. When I insert data directly via SSMS, everything works properly


#2

I’d print the complete SQL statement out and see what it passed to the database. From there you can see where the issue is, and correct.


#3

I was reading about this problem awhile ago. I found that there are several issues with it. The data in the database needs to be inserted as UTF8 values and also, you need to tell the browser to display, them too.
This link talks about solutions near the bottom. Might help you out… SitePoint-Polish-Chars