From 35043288e46838519437c197fe50541831f573b5 Mon Sep 17 00:00:00 2001
From: unknown <1463567152@qq.com>
Date: Sun, 6 Apr 2025 11:05:21 +0800
Subject: [PATCH 01/12] support extracting zip file with certain encoding
---
.../Archives/Decompress/DecompressArchive.cs | 7 +-
.../Data/Contracts/IStorageArchiveService.cs | 11 +-
src/Files.App/Data/Items/EncodingItem.cs | 41 +++++
.../Dialogs/DecompressArchiveDialog.xaml | 30 ++++
src/Files.App/Files.App.csproj | 1 +
src/Files.App/Program.cs | 2 +
.../Services/Storage/StorageArchiveService.cs | 159 +++++++++++++++++-
src/Files.App/Strings/en-US/Resources.resw | 6 +
.../DecompressArchiveDialogViewModel.cs | 23 +++
9 files changed, 277 insertions(+), 3 deletions(-)
create mode 100644 src/Files.App/Data/Items/EncodingItem.cs
diff --git a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs
index 41c8a17e5463..634640b9c30c 100644
--- a/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs
+++ b/src/Files.App/Actions/Content/Archives/Decompress/DecompressArchive.cs
@@ -37,12 +37,15 @@ public override async Task ExecuteAsync(object? parameter = null)
return;
var isArchiveEncrypted = await FilesystemTasks.Wrap(() => StorageArchiveService.IsEncryptedAsync(archive.Path));
+ var isArchiveEncodingUndetermined = await FilesystemTasks.Wrap(() => StorageArchiveService.IsEncodingUndeterminedAsync(archive.Path));
var password = string.Empty;
+ Encoding? encoding = null;
DecompressArchiveDialog decompressArchiveDialog = new();
DecompressArchiveDialogViewModel decompressArchiveViewModel = new(archive)
{
IsArchiveEncrypted = isArchiveEncrypted,
+ IsArchiveEncodingUndetermined = isArchiveEncodingUndetermined,
ShowPathSelection = true
};
decompressArchiveDialog.ViewModel = decompressArchiveViewModel;
@@ -57,6 +60,8 @@ public override async Task ExecuteAsync(object? parameter = null)
if (isArchiveEncrypted && decompressArchiveViewModel.Password is not null)
password = Encoding.UTF8.GetString(decompressArchiveViewModel.Password);
+ encoding = decompressArchiveViewModel.SelectedEncoding.Encoding;
+
// Check if archive still exists
if (!StorageHelpers.Exists(archive.Path))
return;
@@ -72,7 +77,7 @@ public override async Task ExecuteAsync(object? parameter = null)
// Operate decompress
var result = await FilesystemTasks.Wrap(() =>
- StorageArchiveService.DecompressAsync(archive?.Path ?? string.Empty, destinationFolder?.Path ?? string.Empty, password));
+ StorageArchiveService.DecompressAsync(archive?.Path ?? string.Empty, destinationFolder?.Path ?? string.Empty, password, encoding));
if (decompressArchiveViewModel.OpenDestinationFolderOnCompletion)
await NavigationHelpers.OpenPath(destinationFolderPath, context.ShellPage, FilesystemItemType.Directory);
diff --git a/src/Files.App/Data/Contracts/IStorageArchiveService.cs b/src/Files.App/Data/Contracts/IStorageArchiveService.cs
index 97b31b86176b..b95e2a2531a9 100644
--- a/src/Files.App/Data/Contracts/IStorageArchiveService.cs
+++ b/src/Files.App/Data/Contracts/IStorageArchiveService.cs
@@ -1,6 +1,7 @@
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.
+using System.Text;
using SevenZip;
namespace Files.App.Data.Contracts
@@ -37,8 +38,9 @@ public interface IStorageArchiveService
/// The archive file path to decompress.
/// The destination folder path which the archive file will be decompressed to.
/// The password to decrypt the archive file if applicable.
+ /// The file name encoding to decrypt the archive file. If set to null, system default encoding will be used.
/// True if the decompression has done successfully; otherwise, false.
- Task DecompressAsync(string archiveFilePath, string destinationFolderPath, string password = "");
+ Task DecompressAsync(string archiveFilePath, string destinationFolderPath, string password = "", Encoding? encoding = null);
///
/// Generates the archive file name from item names.
@@ -54,6 +56,13 @@ public interface IStorageArchiveService
/// True if the archive file is encrypted; otherwise, false.
Task IsEncryptedAsync(string archiveFilePath);
+ ///
+ /// Gets the value that indicates whether the archive file's encoding is undetermined.
+ ///
+ /// The archive file path to check if the item is encrypted.
+ /// True if the archive file's encoding is undetermined; otherwise, false.
+ Task IsEncodingUndeterminedAsync(string archiveFilePath);
+
///
/// Gets the instance from the archive file path.
///
diff --git a/src/Files.App/Data/Items/EncodingItem.cs b/src/Files.App/Data/Items/EncodingItem.cs
new file mode 100644
index 000000000000..3b244ba8d096
--- /dev/null
+++ b/src/Files.App/Data/Items/EncodingItem.cs
@@ -0,0 +1,41 @@
+// Copyright (c) 2024 Files Community
+// Licensed under the MIT License. See the LICENSE.
+
+using System.Text;
+
+namespace Files.App.Data.Items
+{
+ ///
+ /// Represents a text encoding in the application.
+ ///
+ public sealed class EncodingItem
+ {
+
+ public Encoding? Encoding { get; set; }
+
+ ///
+ /// Gets the encoding name. e.g. English (United States)
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The code of the language.
+ public EncodingItem(string code)
+ {
+ if (string.IsNullOrEmpty(code))
+ {
+ Encoding = null;
+ Name = "ArchiveEncodingSystemDefault".GetLocalizedResource();
+ }
+ else
+ {
+ Encoding = Encoding.GetEncoding(code);
+ Name = Encoding.EncodingName;
+ }
+ }
+
+ public override string ToString() => Name;
+ }
+}
diff --git a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
index fc93af059c8f..96bf0985a8ed 100644
--- a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
+++ b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
@@ -5,7 +5,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:Files.App.Helpers"
+ xmlns:items="using:Files.App.Data.Items"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:uc="using:Files.App.UserControls"
Title="{helpers:ResourceString Name=ExtractArchive}"
CornerRadius="{StaticResource OverlayCornerRadius}"
DefaultButton="Primary"
@@ -80,6 +82,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Files.App/Program.cs b/src/Files.App/Program.cs
index a0239827dc27..8c42e51e5e10 100644
--- a/src/Files.App/Program.cs
+++ b/src/Files.App/Program.cs
@@ -6,6 +6,7 @@
using Microsoft.UI.Xaml;
using Microsoft.Windows.AppLifecycle;
using System.IO;
+using System.Text;
using Windows.ApplicationModel.Activation;
using Windows.Storage;
using static Files.App.Helpers.Win32PInvoke;
@@ -55,6 +56,7 @@ static Program()
[STAThread]
private static void Main()
{
+ Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
WinRT.ComWrappersSupport.InitializeComWrappers();
// We are about to do the first WinRT server call, in case the WinRT server is hanging
diff --git a/src/Files.App/Services/Storage/StorageArchiveService.cs b/src/Files.App/Services/Storage/StorageArchiveService.cs
index 8b705f05acc3..ee7d13cc378b 100644
--- a/src/Files.App/Services/Storage/StorageArchiveService.cs
+++ b/src/Files.App/Services/Storage/StorageArchiveService.cs
@@ -2,8 +2,12 @@
// Licensed under the MIT License. See the LICENSE.
using Files.Shared.Helpers;
+using ICSharpCode.SharpZipLib.Core;
+using ICSharpCode.SharpZipLib.Zip;
using SevenZip;
using System.IO;
+using System.Linq;
+using System.Text;
using Windows.Storage;
using Windows.Win32;
@@ -84,7 +88,17 @@ public async Task CompressAsync(ICompressArchiveModel compressionModel)
}
///
- public async Task DecompressAsync(string archiveFilePath, string destinationFolderPath, string password = "")
+ public Task DecompressAsync(string archiveFilePath, string destinationFolderPath, string password = "", Encoding? encoding = null)
+ {
+ if(encoding == null){
+ return DecompressAsyncWithSevenZip(archiveFilePath, destinationFolderPath, password);
+ }
+ else
+ {
+ return DecompressAsyncWithSharpZipLib(archiveFilePath, destinationFolderPath, password, encoding);
+ }
+ }
+ async Task DecompressAsyncWithSevenZip(string archiveFilePath, string destinationFolderPath, string password = "")
{
if (string.IsNullOrEmpty(archiveFilePath) ||
string.IsNullOrEmpty(destinationFolderPath))
@@ -180,10 +194,134 @@ public async Task DecompressAsync(string archiveFilePath, string destinati
fsProgress.Report();
}
};
+ return isSuccess;
+ }
+
+ async Task DecompressAsyncWithSharpZipLib(string archiveFilePath, string destinationFolderPath, string password, Encoding encoding)
+ {
+ if (string.IsNullOrEmpty(archiveFilePath) ||
+ string.IsNullOrEmpty(destinationFolderPath))
+ return false;
+ using var zipFile = new ZipFile(archiveFilePath, StringCodec.FromEncoding(encoding));
+ if(zipFile is null)
+ return false;
+
+ if(!string.IsNullOrEmpty(password))
+ zipFile.Password = password;
+
+ // Initialize a new in-progress status card
+ var statusCard = StatusCenterHelper.AddCard_Decompress(
+ archiveFilePath.CreateEnumerable(),
+ destinationFolderPath.CreateEnumerable(),
+ ReturnResult.InProgress);
+
+ // Check if the decompress operation canceled
+ if (statusCard.CancellationToken.IsCancellationRequested)
+ return false;
+
+ StatusCenterItemProgressModel fsProgress = new(
+ statusCard.ProgressEventSource,
+ enumerationCompleted: true,
+ FileSystemStatusCode.InProgress,
+ zipFile.Cast().Count(x => !x.IsDirectory));
+ fsProgress.TotalSize = zipFile.Cast().Select(x => (long)x.Size).Sum();
+ fsProgress.Report();
+
+ bool isSuccess = false;
+
+ try
+ {
+ long processedBytes = 0;
+ int processedFiles = 0;
+
+ foreach (ZipEntry zipEntry in zipFile)
+ {
+ if (statusCard.CancellationToken.IsCancellationRequested)
+ {
+ isSuccess = false;
+ break;
+ }
+
+ if (!zipEntry.IsFile)
+ {
+ continue; // Ignore directories
+ }
+
+ string entryFileName = zipEntry.Name;
+ string fullZipToPath = Path.Combine(destinationFolderPath, entryFileName);
+ string directoryName = Path.GetDirectoryName(fullZipToPath);
+
+ if (!Directory.Exists(directoryName))
+ {
+ Directory.CreateDirectory(directoryName);
+ }
+
+ byte[] buffer = new byte[4096]; // 4K is a good default
+ using (Stream zipStream = zipFile.GetInputStream(zipEntry))
+ using (FileStream streamWriter = File.Create(fullZipToPath))
+ {
+ await ThreadingService.ExecuteOnUiThreadAsync(() =>
+ {
+ fsProgress.FileName = entryFileName;
+ fsProgress.Report();
+ });
+
+ StreamUtils.Copy(zipStream, streamWriter, buffer);
+ }
+ processedBytes += zipEntry.Size;
+ if (fsProgress.TotalSize > 0)
+ {
+ fsProgress.Report(processedBytes / (double)fsProgress.TotalSize * 100);
+ }
+ processedFiles++;
+ fsProgress.AddProcessedItemsCount(1);
+ fsProgress.Report();
+ }
+
+ if (!statusCard.CancellationToken.IsCancellationRequested)
+ {
+ isSuccess = true;
+ }
+ }
+ catch (Exception ex)
+ {
+ isSuccess = false;
+ Console.WriteLine($"Error during decompression: {ex.Message}");
+ }
+ finally
+ {
+ // Remove the in-progress status card
+ StatusCenterViewModel.RemoveItem(statusCard);
+
+ if (isSuccess)
+ {
+ // Successful
+ StatusCenterHelper.AddCard_Decompress(
+ archiveFilePath.CreateEnumerable(),
+ destinationFolderPath.CreateEnumerable(),
+ ReturnResult.Success);
+ }
+ else
+ {
+ // Error
+ StatusCenterHelper.AddCard_Decompress(
+ archiveFilePath.CreateEnumerable(),
+ destinationFolderPath.CreateEnumerable(),
+ statusCard.CancellationToken.IsCancellationRequested
+ ? ReturnResult.Cancelled
+ : ReturnResult.Failed);
+ }
+ if (zipFile != null)
+ {
+ zipFile.IsStreamOwner = true; // Makes close also close the underlying stream
+ zipFile.Close();
+ }
+ }
return isSuccess;
}
+
///
public string GenerateArchiveNameFromItems(IReadOnlyList items)
{
@@ -208,6 +346,25 @@ public async Task IsEncryptedAsync(string archiveFilePath)
return zipFile.ArchiveFileData.Any(file => file.Encrypted || file.Method.Contains("Crypto") || file.Method.Contains("AES"));
}
+ ///
+ public async Task IsEncodingUndeterminedAsync(string archiveFilePath)
+ {
+ if (archiveFilePath is null) return false;
+ if (Path.GetExtension(archiveFilePath) != ".zip") return false;
+ try
+ {
+ using (ZipFile zipFile = new ZipFile(archiveFilePath))
+ {
+ return !zipFile.Cast().All(entry=>entry.IsUnicodeText);
+ }
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"SharpZipLib error: {ex.Message}");
+ return true;
+ }
+ }
+
///
public async Task GetSevenZipExtractorAsync(string archiveFilePath, string password = "")
{
diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw
index f4ddb611460d..5d18c370ba85 100644
--- a/src/Files.App/Strings/en-US/Resources.resw
+++ b/src/Files.App/Strings/en-US/Resources.resw
@@ -2093,6 +2093,12 @@
Archive password
+
+ Archive encoding
+
+
+ Windows default
+
Path
diff --git a/src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs
index 3fd8e2e92f78..b9dcac50fe34 100644
--- a/src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs
+++ b/src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs
@@ -2,6 +2,7 @@
// Licensed under the MIT License. See the LICENSE.
using System.IO;
+using System.Text;
using System.Windows.Input;
using Vanara.PInvoke;
using Windows.Storage;
@@ -37,6 +38,13 @@ public bool IsArchiveEncrypted
set => SetProperty(ref isArchiveEncrypted, value);
}
+ private bool isArchiveEncodingUndetermined;
+ public bool IsArchiveEncodingUndetermined
+ {
+ get => isArchiveEncodingUndetermined;
+ set => SetProperty(ref isArchiveEncodingUndetermined, value);
+ }
+
private bool showPathSelection;
public bool ShowPathSelection
{
@@ -46,6 +54,20 @@ public bool ShowPathSelection
public DisposableArray? Password { get; private set; }
+ public EncodingItem[] EncodingOptions { get; set; } = new string?[] {
+ null,//System Default
+ "UTF-8",
+ "shift_jis",
+ "gb2312",
+ "big5",
+ "ks_c_5601-1987",
+ "Windows-1252",
+ "macintosh",
+ }
+ .Select(x=>new EncodingItem(x))
+ .ToArray();
+ public EncodingItem SelectedEncoding { get; set; }
+
public IRelayCommand PrimaryButtonClickCommand { get; private set; }
public ICommand SelectDestinationCommand { get; private set; }
@@ -54,6 +76,7 @@ public DecompressArchiveDialogViewModel(IStorageFile archive)
{
this.archive = archive;
destinationFolderPath = DefaultDestinationFolderPath();
+ SelectedEncoding = EncodingOptions[0];
// Create commands
SelectDestinationCommand = new AsyncRelayCommand(SelectDestinationAsync);
From 06094d21eea844895a14bc575785d9e84607033c Mon Sep 17 00:00:00 2001
From: unknown <1463567152@qq.com>
Date: Sun, 6 Apr 2025 11:18:47 +0800
Subject: [PATCH 02/12] prepare for sync from latest
---
src/Files.App/Files.App.csproj | 96 ++++++++++++++++------------------
1 file changed, 45 insertions(+), 51 deletions(-)
diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj
index 544e376047c7..31d0e6497915 100644
--- a/src/Files.App/Files.App.csproj
+++ b/src/Files.App/Files.App.csproj
@@ -1,14 +1,14 @@
-
+
- net8.0-windows10.0.22621.0
+ $(WindowsTargetFramework)
WinExe
Files
en-US
Scale|DXFeatureLevel
- Language=en-US;af;ar;be-BY;bg;ca;cs-CZ;da;de-DE;el;en-GB;es-ES;es-419;fa-IR;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hr-HR;hu-HU;id-ID;it-IT;ja-JP;ka;km-KH;ko-KR;lt-LT;lv-LV;ms-MY;nb-NO;nl-NL;pl-PL;pt-BR;pt-PT;ro-RO;ru-RU;sk-SK;sq-AL;sr-Cyrl;sv-SE;ta;th-TH;tr-TR;uk-UA;vi;zh-Hans;zh-Hant
- 10.0.19041.0
+ Language=en-US;af;ar;be-BY;bg;ca;cs-CZ;da;de-DE;el;en-GB;es-ES;es-419;fa-IR;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hr-HR;hu-HU;hy-AM;id-ID;it-IT;ja-JP;ka;km-KH;ko-KR;lt-LT;lv-LV;ms-MY;nb-NO;nl-NL;pl-PL;pt-BR;pt-PT;ro-RO;ru-RU;sk-SK;sq-AL;sr-Cyrl;sv-SE;ta;th-TH;tr-TR;uk-UA;vi;zh-Hans;zh-Hant
+ $(MinimalWindowsVersion)
False
SHA256
False
@@ -24,7 +24,7 @@
true
true
true
- Debug;Release;Stable;Preview;Store
+ Debug;Release
Files.App.Server;Microsoft.UI.Content.ContentExternalOutputLink;Microsoft.UI.Content.IContentExternalOutputLink
bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
False
@@ -33,12 +33,8 @@
..\Files.App (Package)\Assets\AppTiles\Dev\Logo.ico
-
- TRACE;DEBUG;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN
-
-
- TRACE;RELEASE;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN
- true
+
+ $(DefineConstants);DISABLE_XAML_GENERATED_MAIN
@@ -66,33 +62,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -122,19 +129,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
From 5d9c4bab3b12be177a5f5c5df78721de1125567c Mon Sep 17 00:00:00 2001
From: unknown <1463567152@qq.com>
Date: Sun, 6 Apr 2025 11:44:41 +0800
Subject: [PATCH 03/12] add back sharpziplib
---
Directory.Packages.props | 1 +
src/Files.App/Files.App.csproj | 1 +
2 files changed, 2 insertions(+)
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 81af77f22b58..d3c069caa7e7 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -32,6 +32,7 @@
+
diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj
index 31d0e6497915..78196a615a92 100644
--- a/src/Files.App/Files.App.csproj
+++ b/src/Files.App/Files.App.csproj
@@ -89,6 +89,7 @@
+
From 86d1b34c0ae600dbcd5ace1c489d94512812cdeb Mon Sep 17 00:00:00 2001
From: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
Date: Wed, 9 Apr 2025 07:03:10 +0800
Subject: [PATCH 04/12] Update
src/Files.App/Dialogs/DecompressArchiveDialog.xaml
Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com>
Signed-off-by: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
---
src/Files.App/Dialogs/DecompressArchiveDialog.xaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
index 8aab9652becf..9aa8da25ea54 100644
--- a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
+++ b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
@@ -93,7 +93,7 @@
x:Name="EncodingHeader"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
- Text="{helpers:ResourceString Name=ArchiveEncoding}" />
+ Text="{helpers:ResourceString Name=Encoding}" />
Date: Wed, 9 Apr 2025 07:03:26 +0800
Subject: [PATCH 05/12] Update
src/Files.App/Dialogs/DecompressArchiveDialog.xaml
Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com>
Signed-off-by: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
---
src/Files.App/Dialogs/DecompressArchiveDialog.xaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
index 9aa8da25ea54..3b90c40f843d 100644
--- a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
+++ b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
@@ -85,7 +85,7 @@
From f1c956e0dd1fef0de3d8c50413efdcb36fe494ab Mon Sep 17 00:00:00 2001
From: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
Date: Wed, 9 Apr 2025 07:03:35 +0800
Subject: [PATCH 06/12] Update
src/Files.App/Dialogs/DecompressArchiveDialog.xaml
Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com>
Signed-off-by: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
---
src/Files.App/Dialogs/DecompressArchiveDialog.xaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
index 3b90c40f843d..693c60baf679 100644
--- a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
+++ b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
@@ -99,7 +99,7 @@
x:Name="EncodingBox"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
- ItemsSource="{x:Bind ViewModel.EncodingOptions}"
+ ItemsSource="{x:Bind ViewModel.EncodingOptions, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.SelectedEncoding, Mode=TwoWay}">
From 42e634675081f3144f177ccf76ccc9973c183fa0 Mon Sep 17 00:00:00 2001
From: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
Date: Wed, 9 Apr 2025 07:03:45 +0800
Subject: [PATCH 07/12] Update src/Files.App/Strings/en-US/Resources.resw
Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com>
Signed-off-by: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
---
src/Files.App/Strings/en-US/Resources.resw | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw
index 0bf2a0272074..72514e4692a3 100644
--- a/src/Files.App/Strings/en-US/Resources.resw
+++ b/src/Files.App/Strings/en-US/Resources.resw
@@ -2097,7 +2097,7 @@
Archive password
- Archive encoding
+ Encoding
Windows default
From 0c3ed1f298ed7f7cd3edf52235bd33ab57415188 Mon Sep 17 00:00:00 2001
From: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
Date: Wed, 9 Apr 2025 07:03:57 +0800
Subject: [PATCH 08/12] Update src/Files.App/Data/Items/EncodingItem.cs
Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com>
Signed-off-by: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
---
src/Files.App/Data/Items/EncodingItem.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Files.App/Data/Items/EncodingItem.cs b/src/Files.App/Data/Items/EncodingItem.cs
index 3b244ba8d096..c342c64fc9c8 100644
--- a/src/Files.App/Data/Items/EncodingItem.cs
+++ b/src/Files.App/Data/Items/EncodingItem.cs
@@ -27,7 +27,7 @@ public EncodingItem(string code)
if (string.IsNullOrEmpty(code))
{
Encoding = null;
- Name = "ArchiveEncodingSystemDefault".GetLocalizedResource();
+ Name = Strings.Default.GetLocalizedResource();
}
else
{
From 3a699fb25f06db783ee3cecc8938e99121d2fb97 Mon Sep 17 00:00:00 2001
From: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
Date: Wed, 9 Apr 2025 07:04:31 +0800
Subject: [PATCH 09/12] Update src/Files.App/Strings/en-US/Resources.resw
Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com>
Signed-off-by: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
---
src/Files.App/Strings/en-US/Resources.resw | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw
index 72514e4692a3..2e08771c4fb6 100644
--- a/src/Files.App/Strings/en-US/Resources.resw
+++ b/src/Files.App/Strings/en-US/Resources.resw
@@ -2099,9 +2099,6 @@
Encoding
-
- Windows default
-
Path
From 00aeac8bceb9c55a58bcc0cc84f9932852045e94 Mon Sep 17 00:00:00 2001
From: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
Date: Wed, 9 Apr 2025 07:04:40 +0800
Subject: [PATCH 10/12] Update
src/Files.App/Dialogs/DecompressArchiveDialog.xaml
Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com>
Signed-off-by: oxygen-dioxide <54425948+oxygen-dioxide@users.noreply.github.com>
---
src/Files.App/Dialogs/DecompressArchiveDialog.xaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
index 693c60baf679..3b25e960581e 100644
--- a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
+++ b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
@@ -95,7 +95,7 @@
VerticalAlignment="Stretch"
Text="{helpers:ResourceString Name=Encoding}" />
-
Date: Wed, 9 Apr 2025 07:50:50 +0800
Subject: [PATCH 11/12] combobox
---
src/Files.App/Dialogs/DecompressArchiveDialog.xaml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
index 3b25e960581e..732f04e7072d 100644
--- a/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
+++ b/src/Files.App/Dialogs/DecompressArchiveDialog.xaml
@@ -101,12 +101,12 @@
VerticalAlignment="Stretch"
ItemsSource="{x:Bind ViewModel.EncodingOptions, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.SelectedEncoding, Mode=TwoWay}">
-
+
-
-
+
+
From ef6a27022b115b1f2ae2034ed6f3a71d4b31b7f0 Mon Sep 17 00:00:00 2001
From: unknown <1463567152@qq.com>
Date: Wed, 9 Apr 2025 07:57:41 +0800
Subject: [PATCH 12/12] string key was changed from 'ArchiveEncoding' to
'Encoding'
---
src/Files.App/Strings/en-US/Resources.resw | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw
index 2e08771c4fb6..6abdb2f79735 100644
--- a/src/Files.App/Strings/en-US/Resources.resw
+++ b/src/Files.App/Strings/en-US/Resources.resw
@@ -2096,7 +2096,7 @@
Archive password
-
+
Encoding