Skip to content

Instantly share code, notes, and snippets.

@sajt
Created October 23, 2016 08:15
Show Gist options
  • Save sajt/e775626907f05d1a9d34d057c0d001e3 to your computer and use it in GitHub Desktop.
Save sajt/e775626907f05d1a9d34d057c0d001e3 to your computer and use it in GitHub Desktop.
Convert ugly hungarian utf-8 to a better one
<?php
$file = file("sql.sql");
$file = join("", $file);
$file = html_entity_decode($file);
$search =
array('é', 'ő', 'ü', 'ű', 'ó', 'ö', 'á', 'í', '©', 'Ú', 'ú', 'É');
$replace =
array('é' , 'ő' , 'ü' , 'ű' , 'ó' , 'ö' , 'á' , 'í', '©' , 'Ú' , 'ú' , 'É');
$file = str_replace($search, $replace, $file);
echo $file;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment