Menu

#26 Can't save: "Value cannot be null. Parameter name: encoding.

open
nobody
7
2022-05-23
2012-12-06
No

I get this bug when trying to save and cannot save my work either in srt or txt format, I've been working for 2-3 hours and can't save at all!! Here are the details offered with the error message box. Clicking on continue returns me to the program.

************** Exception Text **************
System.ArgumentNullException: Value cannot be null.
Parameter name: encoding
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
at Microsoft.VisualBasic.FileIO.FileSystem.OpenTextFileWriter(String file, Boolean append, Encoding encoding)
at Microsoft.VisualBasic.MyServices.FileSystemProxy.OpenTextFileWriter(String file, Boolean append, Encoding encoding)
at OpenSubtitleEditor.Subtitles.save()
at OpenSubtitleEditor.frmMain.SaveToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5466 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
OpenSubtitleEditor
Assembly Version: 0.1.2.39
Win32 Version: 0.1.2.39
CodeBase: file:///C:/Program%20Files/Open%20Subtitle%20Editor/OpenSubtitleEditor.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.5420 (Win7SP1.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5466 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5460 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5462 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
AxInterop.WMPLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Open%20Subtitle%20Editor/AxInterop.WMPLib.DLL
----------------------------------------
DataGridViewCustomColumn
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///C:/Program%20Files/Open%20Subtitle%20Editor/DataGridViewCustomColumn.DLL
----------------------------------------
Interop.WMPLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Open%20Subtitle%20Editor/Interop.WMPLib.DLL
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.5420 built by: Win7SP1
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

Discussion

  • Lefteris Aslanoglou

    I'm sorry, but this project has been inactive for 2 years, and I'm no longer offering support for it. The source for the latest version is available if anyone wants to take over the project and continue it.

     
  • Lefteris Aslanoglou

    • priority: 5 --> 7
     
  • Lefteris Aslanoglou

    10 years too late, but I took a look at this project once again, and the crash on save happens if you haven't opened a file in the application run (i.e. you're trying to save a file you created from scratch without having opened a different file at any point since starting the application).

    The only workaround is to open a different SRT file first, and then go to File > New to start working.

    That said, since I no longer have admin rights to the SF project or the website, I quickly re-published it here, and fixed a couple of bugs, including this one:
    https://github.com/leftos/opensubtitleed
    You can download the re-release with this save bug fixed from here:
    https://github.com/leftos/opensubtitleed/releases/tag/windows-x86

     

Log in to post a comment.

MongoDB Logo MongoDB