-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set WebClient encoding to UTF-8 explicitly #2577
set WebClient encoding to UTF-8 explicitly #2577
Conversation
Does this work on a Japanese Windows? Downloading works, but extraction still fails:
|
I guess it is another issue, depends on zip file name encoding. diff --git a/lib/core.ps1 b/lib/core.ps1 index 505ffefb..b99ce0d9 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -264,7 +264,7 @@ function unzip($path, $to) { } try { - [io.compression.zipfile]::extracttodirectory($path,$to) + [io.compression.zipfile]::extracttodirectory($path,$to,[System.Text.Encoding]::GetEncoding("shift-jis")) } catch [system.io.pathtoolongexception] { # try to fall back to 7zip if path is too long if(7zip_installed) { About this problem: https://marcosc.com/2008/12/zip-files-and-encoding-i-hate-you/ I found one more issue. PS C:\Users\Administrator\scoop\apps\scoop\current> .\bin\scoop.ps1 install https://raw.githubusercontent.com/yukihane/s coop-bucket-yukihane-games/91d960886de11fc41137918394b9de2f943da616/densya.json Installing 'densya' (1.06) [64bit] Loading dcnt.cgi from cache Checking hash of dcnt.cgi ... ok. Extracting densya.zip ... done. Running pre-install script... Linking ~\scoop\apps\densya\current => ~\scoop\apps\densya\1.06 Creating shim for 'densya'. Unable to save shortcut "C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps\????.lnk". At C:\Users\Administrator\scoop\apps\scoop\current\lib\shortcuts.ps1:56 char:5 + $wsShell.Save() + ~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], FileNotFoundException + FullyQualifiedErrorId : System.IO.FileNotFoundException Creating shortcut for デンシャ (Game.exe) Persisting Game.ini Persisting Save 'densya' (1.06) was installed successfully! I found a solution using C#, but I can not understand this code ...: |
Superceded by #4912 |
refs. #2573
https://stackoverflow.com/a/2019322/4506703