diff --git a/packages/flutter_tools/bin/xcode_backend.dart b/packages/flutter_tools/bin/xcode_backend.dart index 04f86e5d20..37ad2a4fd0 100644 --- a/packages/flutter_tools/bin/xcode_backend.dart +++ b/packages/flutter_tools/bin/xcode_backend.dart @@ -190,6 +190,7 @@ class Context { runSync( 'rsync', [ + '-8', // Avoid mangling filenames with encodings that do not match the current locale. '-av', '--delete', '--filter', diff --git a/packages/flutter_tools/lib/src/base/os.dart b/packages/flutter_tools/lib/src/base/os.dart index b106783d3e..d3bb740835 100644 --- a/packages/flutter_tools/lib/src/base/os.dart +++ b/packages/flutter_tools/lib/src/base/os.dart @@ -451,8 +451,9 @@ class _MacOSUtils extends _PosixUtils { ); for (final FileSystemEntity unzippedFile in tempDirectory.listSync(followLinks: false)) { // rsync --delete the unzipped files so files removed from the archive are also removed from the target. + // Add the '-8' parameter to avoid mangling filenames with encodings that do not match the current locale. _processUtils.runSync( - ['rsync', '-av', '--delete', unzippedFile.path, targetDirectory.path], + ['rsync', '-8', '-av', '--delete', unzippedFile.path, targetDirectory.path], throwOnError: true, verboseExceptions: true, ); diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index c34575e00e..ee902b38ac 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -462,6 +462,7 @@ Future buildXcodeProject({ await globals.processUtils.run( [ 'rsync', + '-8', // Avoid mangling filenames with encodings that do not match the current locale. '-av', '--delete', expectedOutputDirectory, diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart index 6f4a98ec84..922ade2041 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart @@ -84,6 +84,7 @@ void main() { return FakeCommand( command: const [ 'rsync', + '-8', '-av', '--delete', 'build/ios/Release-iphoneos/Runner.app', diff --git a/packages/flutter_tools/test/general.shard/base/os_test.dart b/packages/flutter_tools/test/general.shard/base/os_test.dart index 3621c619c5..637fd65fc6 100644 --- a/packages/flutter_tools/test/general.shard/base/os_test.dart +++ b/packages/flutter_tools/test/general.shard/base/os_test.dart @@ -586,6 +586,7 @@ void main() { ), FakeCommand(command: [ 'rsync', + '-8', '-av', '--delete', tempDirectory.childDirectory('dirA').path, @@ -593,6 +594,7 @@ void main() { ]), FakeCommand(command: [ 'rsync', + '-8', '-av', '--delete', tempDirectory.childDirectory('dirB').path, diff --git a/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart index 81eb857fa5..0acb7ec80c 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart @@ -188,6 +188,7 @@ void main() { processManager.addCommand(const FakeCommand(command: kRunReleaseArgs)); processManager.addCommand(const FakeCommand(command: [ 'rsync', + '-8', '-av', '--delete', 'build/ios/Release-iphoneos/My Super Awesome App.app',