From 630d5b3b6e221abe1e2ad7d8822edb69ee6198dd Mon Sep 17 00:00:00 2001 From: danrahn Date: Sun, 2 Jun 2024 11:39:38 -0700 Subject: [PATCH] [Windows] Ensure PowerShell uses UTF-8 Encoding --- README.md | 2 +- .../DBRepair-Windows.bat | 0 .../DBRepair-Windows.ps1 | 10 +++++++++- .../DBRepair-Windows.zip | Bin README-Windows.md => Windows/README-Windows.md | 0 .../ReleaseNotes-Windows | 3 +++ 6 files changed, 13 insertions(+), 2 deletions(-) rename DBRepair-Windows.bat => Windows/DBRepair-Windows.bat (100%) rename DBRepair-Windows.ps1 => Windows/DBRepair-Windows.ps1 (98%) rename DBRepair-Windows.zip => Windows/DBRepair-Windows.zip (100%) rename README-Windows.md => Windows/README-Windows.md (100%) rename ReleaseNotes-Windows => Windows/ReleaseNotes-Windows (82%) diff --git a/README.md b/README.md index ee16375..96b96f9 100644 --- a/README.md +++ b/README.md @@ -989,4 +989,4 @@ sudo ./DBRepair.sh stop auto start exit # Special Considerations - Windows -Windows support is available via DBRepair-Windows.ps1 and DBRepair-Windows.bat. See [README-Windows](README-Windows.md) for details. \ No newline at end of file +Windows support is available via DBRepair-Windows.ps1 and DBRepair-Windows.bat. See [README-Windows](Windows/README-Windows.md) for details. \ No newline at end of file diff --git a/DBRepair-Windows.bat b/Windows/DBRepair-Windows.bat similarity index 100% rename from DBRepair-Windows.bat rename to Windows/DBRepair-Windows.bat diff --git a/DBRepair-Windows.ps1 b/Windows/DBRepair-Windows.ps1 similarity index 98% rename from DBRepair-Windows.ps1 rename to Windows/DBRepair-Windows.ps1 index bb2acec..0ef606e 100644 --- a/DBRepair-Windows.ps1 +++ b/Windows/DBRepair-Windows.ps1 @@ -3,7 +3,7 @@ # # ######################################################################### -$PlexDBRepairVersion = 'v1.00.00' +$PlexDBRepairVersion = 'v1.00.01' class PlexDBRepair { [PlexDBRepairOptions] $Options @@ -785,4 +785,12 @@ class CleanCacheResult { } } +# Ensure the console can handle utf-8, as the export process pipes utf-8 data from the console to our temporary sql file. +$InputEncodingSave = [console]::InputEncoding +$OutputEncodingSave = [console]::OutputEncoding +[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding + [void]([PlexDBRepair]::new($args, $PlexDBRepairVersion)) + +[console]::OutputEncoding = $OutputEncodingSave +[console]::InputEncoding = $InputEncodingSave diff --git a/DBRepair-Windows.zip b/Windows/DBRepair-Windows.zip similarity index 100% rename from DBRepair-Windows.zip rename to Windows/DBRepair-Windows.zip diff --git a/README-Windows.md b/Windows/README-Windows.md similarity index 100% rename from README-Windows.md rename to Windows/README-Windows.md diff --git a/ReleaseNotes-Windows b/Windows/ReleaseNotes-Windows similarity index 82% rename from ReleaseNotes-Windows rename to Windows/ReleaseNotes-Windows index 6276ccc..81c37ce 100644 --- a/ReleaseNotes-Windows +++ b/Windows/ReleaseNotes-Windows @@ -4,6 +4,9 @@ Release notes for the Windows counterpart to DBRepair.sh (DBRepair-Windows.ps1) # Release Info +v1.00.01 + - Bug Fix: Ensure UTF-8 characters get exported/imported properly. + v1.00.00 - Initial Windows PowerShell script release, aiming to provide a similar experience as DBRepair.sh, with command-name-based input. - Initial command support: