Skip to content

Instantly share code, notes, and snippets.

@mistbow
Created November 25, 2013 03:01
Show Gist options
  • Select an option

  • Save mistbow/7635607 to your computer and use it in GitHub Desktop.

Select an option

Save mistbow/7635607 to your computer and use it in GitHub Desktop.
convert_file_encoding
<?php
// convert file from GBK to UTF8
$file = "filename";
$content = file_get_contents($file);
$cotennt = mb_convert_encoding($content, 'UTF8', 'GBK');
file_put_contents($file . ".utf8", $content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment