OpenJudgeSystem icon indicating copy to clipboard operation
OpenJudgeSystem copied to clipboard

When user submits code that sets endoding, an IOException is thrown

Open NikolayIT opened this issue 12 years ago • 2 comments

This code:

class Program
{
    static void Main(string[] args)
    {
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        Console.OutputEncoding = Encoding.UTF8;
    }
}

throws

Unhandled Exception: System.IO.IOException: The handle is invalid.
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.Console.set_OutputEncoding(Encoding value)
    at _05.Bittris.Program.Main(String[] args)

NikolayIT avatar Sep 06 '13 08:09 NikolayIT

Can be tested with old system on address .../Contest/ViewCode/188896

NikolayIT avatar Sep 06 '13 08:09 NikolayIT

Expected behaviour?

NikolayIT avatar Feb 25 '14 17:02 NikolayIT