Merge pull request #158 from danrahn/master

[Windows] Ensure PowerShell uses UTF-8 Encoding
This commit is contained in:
Chuck 2024-06-02 18:29:19 -04:00 committed by GitHub
commit 9c1008cf52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 13 additions and 2 deletions

View File

@ -989,4 +989,4 @@ sudo ./DBRepair.sh stop auto start exit
# Special Considerations - Windows # Special Considerations - Windows
Windows support is available via DBRepair-Windows.ps1 and DBRepair-Windows.bat. See [README-Windows](README-Windows.md) for details. Windows support is available via DBRepair-Windows.ps1 and DBRepair-Windows.bat. See [README-Windows](Windows/README-Windows.md) for details.

View File

@ -3,7 +3,7 @@
# # # #
######################################################################### #########################################################################
$PlexDBRepairVersion = 'v1.00.00' $PlexDBRepairVersion = 'v1.00.01'
class PlexDBRepair { class PlexDBRepair {
[PlexDBRepairOptions] $Options [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)) [void]([PlexDBRepair]::new($args, $PlexDBRepairVersion))
[console]::OutputEncoding = $OutputEncodingSave
[console]::InputEncoding = $InputEncodingSave

View File

@ -4,6 +4,9 @@ Release notes for the Windows counterpart to DBRepair.sh (DBRepair-Windows.ps1)
# Release Info # Release Info
v1.00.01
- Bug Fix: Ensure UTF-8 characters get exported/imported properly.
v1.00.00 v1.00.00
- Initial Windows PowerShell script release, aiming to provide a similar experience as DBRepair.sh, with command-name-based input. - Initial Windows PowerShell script release, aiming to provide a similar experience as DBRepair.sh, with command-name-based input.
- Initial command support: - Initial command support: