1

I'm accessing a MS SQL Server 2008 R2 database via ODBC (32-Bit SQL-Server driver) to get some data with special characters in them. When I var_dump the data with the special characters in php (windows console not in browser) I don't get the correct characters (e.g. "³" for "ß").

I've tried to change the collation but I don't really know which one to use to get the correct characters.

The mssql column is a varchar with collation Latin1_General_CI_AS.

And in the ODBC configuration I marked the "perform translation for character data".

I've been searching for hours now but haven't anything of use yet. Any ideas?

MrSmith
  • 370
  • 4
  • 22
  • 1
    you need to use the same charset throughout the entire rendering pipeline, or have the individual stages connect with appropriate translation logic. that means the php<->db connection. php<->console, etc... use `chcp` to see what codepage your console is using, then have php convert the text to that before output. – Marc B Jan 30 '15 at 16:05
  • man thx. I couldn't get the console to show the proper characters but with that info that the console is using another charset too I came to the right solution: http://stackoverflow.com/a/7980354/3123040. The reason I tried all that was to get that data into a mysql database. With the code in the first answer the database now has the correct chars. – MrSmith Jan 30 '15 at 16:30

0 Answers0