mirror of
https://github.com/imrayya/SRTto3Dsubtitles.git
synced 2026-09-21 10:17:27 +02:00
fix: wire up GUI browse buttons, make text boxes editable, pause CLI on error, register codepage provider
GUI: - Attach Click event handlers to browse input/output buttons (were defined but never wired up) - Remove ReadOnly=true from input/output text boxes so users can type or copy paths CLI: - Make Cli.Run return bool to signal errors - Only pause with Console.ReadLine() when an error occurs (not on success) - Fix default case to return true Core: - Add System.Text.Encoding.CodePages package for CP1252 SRT file support - Call Encoding.RegisterProvider(CodePagesEncodingProvider.Instance) before reading files
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
<RootNamespace>ConvertSRTto3DASS</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -16,6 +16,9 @@ public static class SrtConverter
|
||||
|
||||
public static ConversionResult Convert(ConversionOptions options)
|
||||
{
|
||||
// Register legacy codepage support (needed for CP1252, etc.)
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
|
||||
var srtText = ReadSrt(options.InputPath);
|
||||
var subtitles = ParseSrt(srtText);
|
||||
var header = CreateHeader(options);
|
||||
|
||||
Reference in New Issue
Block a user