Subject: Problems uploading files with non-English characters on Win 10
From: Terri
Date: Sun, 15 May 2022 08:21:23 +0000
Hi,

I think there might be a bug with megatools (experimental: megatools-1.11.0-git-20220401-win64) where it won't upload files that contain non-English characters. I'm using PowerShell on Windows 10 64-bit.

For example, trying to upload this file C:\Upload\Привет мир.txt​ with:

megatools put -u my@email.com -p mypassword "C:\Upload\Привет мир.txt" --path "/Root/" --reload

This is the error message that I get:

ERROR: Upload failed for 'C:\Upload\?????? ???.txt': Can't read local file C:\Upload\?????? ???.txt: Error opening file C:\Upload\?????? ???.txt: Invalid argument

Changing the console input and output encoding to UTF-8 doesn't help either:
[Console]::InputEncoding = [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding

The same thing happens in command prompt as well.

However, it does work ok with megacmd in PowerShell, the displayed text in the PowerShell console might be messed up, but the file is still uploaded with the correct characters nonetheless.

Any assistance would be much appreciated.

Thanks,
T