Subject: Re: Problems uploading files with non-English characters on Win 10
From: Ondřej Jirman
Date: Mon, 16 May 2022 16:53:57 +0200

On Sun, May 15, 2022 at 08:21:23AM +0000, Terri wrote:
> 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 -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.

Check what environment variables megacmd sets and set them, yourself in
powershell before running megatools. That should help.

kind regards,

> Thanks,
> T