Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.