Skip to content

Instantly share code, notes, and snippets.

@Const-me
Created September 15, 2018 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Const-me/7c787cb4f4e5bcb2e5c0d8e40ff5cf18 to your computer and use it in GitHub Desktop.
Save Const-me/7c787cb4f4e5bcb2e5c0d8e40ff5cf18 to your computer and use it in GitHub Desktop.
using System;
using System.Text;
using System.IO;
namespace ChineeseDecode
{
class Program
{
static void main( string path )
{
Encoding enc = Encoding.GetEncoding( 936 ); // Codepage #936 "Chinese Main Land"
string all;
using( var f = new StreamReader( path, enc ) )
all = f.ReadToEnd();
File.Delete( path );
using( var f = new StreamWriter( path, false, Encoding.UTF8 ) )
f.Write( all );
}
static void Main( string[] args )
{
try
{
main( args[ 0 ] );
}
catch( Exception ex )
{
Console.WriteLine( ex.Message );
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment