fix: Windows integration not working for non-ascii file names #405
Massimo Melina committed
Nov 29, 2023 at 22:13 UTC
71ed2a69152ec081e9a7ab6a815e33a7fd87760f
1 file changed
+1
-1
src/api.vfs.ts
+1
-1
@@ -265,7 +265,7 @@ export async function windowsIntegration() {
265
for (const k of ['*', 'Directory']) {
266
await reg('add', WINDOWS_REG_KEY.replace('*', k), '/ve', '/f', '/d', 'Add to HFS (new)')
267
await reg('add', WINDOWS_REG_KEY.replace('*', k) + '\\command', '/ve', '/f', '/d', `powershell -Command "
268
- $j = '{ \\"source\\": "' + ('%1'|convertTo-json) + '" }'; $wsh = New-Object -ComObject Wscript.Shell;
268
+ $j = '{ \\"source\\": "' + ('%1'|convertTo-json) + '" }'; $wsh = New-Object -ComObject Wscript.Shell; $j = [System.Text.Encoding]::UTF8.GetBytes($j);
269
try { $res = Invoke-WebRequest -Uri '${url}/~/api/add_vfs' -Method POST -Headers @{ 'x-hfs-anti-csrf' = '1' } -ContentType 'application/json' -TimeoutSec 1 -Body $j;
270
$json = $res.Content | ConvertFrom-Json; $link = $json.link; $link | Set-Clipboard; } catch { $wsh.Popup('Server is down', 0, 'Error', 16); }"`)
271
}