@@ -15,6 +15,7 @@ import (
1515 "github.com/rclone/rclone/fs/filter"
1616 "github.com/rclone/rclone/fs/list"
1717 "github.com/rclone/rclone/fs/walk"
18+ "github.com/rclone/rclone/lib/encoder"
1819 "github.com/rclone/rclone/lib/transform"
1920 "golang.org/x/text/unicode/norm"
2021)
@@ -80,6 +81,10 @@ func (m *March) init(ctx context.Context) {
8081 }
8182}
8283
84+ type Encoderer interface {
85+ Encoder () encoder.Encoder
86+ }
87+
8388// srcOrDstKey turns a directory entry into a sort key using the defined transforms.
8489func (m * March ) srcOrDstKey (entry fs.DirEntry , isSrc bool ) string {
8590 if entry == nil {
@@ -89,6 +94,12 @@ func (m *March) srcOrDstKey(entry fs.DirEntry, isSrc bool) string {
8994 _ , isDirectory := entry .(fs.Directory )
9095 if isSrc {
9196 name = transform .Path (m .Ctx , name , isDirectory )
97+ // Encode src name using dst Fs encoder to normalize for comparison
98+ // Interface check for backends that encode filenames (e.g., Box with EncodeUnicodeBMP)
99+ if enc , ok := m .Fdst .(Encoderer ); ok {
100+ encoder := enc .Encoder ()
101+ name = encoder .ToStandardPath (encoder .FromStandardPath (name ))
102+ }
92103 }
93104 for _ , transform := range m .transforms {
94105 name = transform (name )
0 commit comments