[PHP] Special characters being replaced with black diamonds with question mark �

If you ever come across this issue where special characters in your PHP wep add like aprostrophe's and ñ's are being replaced by this weird symbol, �, it could be a char-set thing.


I tried a couple of solutions but none of them worked, until I looked into my php.ini for anything related to setting the character encoding, and I found that the default_charset is set to UTF-8.

I simply changed it to ISO-8859-1, restarted the IIS server, and refreshed the page.


And it worked!

Php.ini can be found on your PHP installation folder, in my case: 
C:\Program Files (x86)\PHP\php-7.4.8\php.ini

Set default_charset to ISO-8859-1 and enable it by removing the ; in front
default_charset = "iso-8859-1"
Share:

[SQL Server] How to export table data as insert statements

In case you want to export all the rows in a table as insert statements, here's how to do it:
  1. Open MS SQL Server Management studio and login to your desired database server
  2. Right click database >> Tasks >> Generate Scripts
  3. Choose Objects: Select specific database objects >> Select the table you want to export
  4. Set scripting options: Select Save to file then click Advanced
  5. Under advanced >> General Options >> Types of data to script - choose Data only >> Click OK

  6. Proceed to next steps until table is successfully scripted, the click on Finish
And you're done, you've now exported table data as insert statements.
Share: