[Windows] Ensure PowerShell uses UTF-8 Encoding

This commit is contained in:
danrahn 2024-06-02 11:39:38 -07:00
parent 1a75cc9ede
commit 630d5b3b6e
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
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 {
[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

View File

@ -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: