quamotion / madb

SharpAdbClient is a .NET library that allows .NET applications to communicate with Android devices. It provides a .NET implementation of the adb protocol, giving more flexibility to the developer than launching an adb.exe process and parsing the console output.
Apache License 2.0
361 stars 133 forks source link

Filename of Download/Upload with characters other than English/Numbers #220

Closed CometoA closed 2 years ago

CometoA commented 2 years ago

If the filename contains characters other than English/numbers (e.g. Chinese/Japanese), the destination file would become "?" characters.

Take Upload as example:

using (SyncService service = new SyncService(new AdbSocket(new IPEndPoint(IPAddress.Loopback, AdbClient.AdbServerPort)), device))
using (Stream stream = File.OpenRead(@"C:\MyFile.txt"))
{
    service.Push(stream, "/data/local/tmp/ひらがな.txt", 444, DateTime.Now, null, CancellationToken.None);
}

The file uploaded would become ????.txt

May I know is there any place allow us to set the encoding?