Encoding output before sending it to php, so special characters get
saved correctly...