File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
Maui/Prism.Maui/Navigation/Regions/Navigation
Wpf/Prism.Wpf/Navigation/Regions
tests/Maui/Prism.Maui.Tests/Fixtures/Common Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ protected virtual string GetContractFromNavigationContext(NavigationContext navi
9191
9292 var candidateTargetContract = UriParsingHelper . EnsureAbsolute ( navigationContext . Uri ) . AbsolutePath ;
9393 candidateTargetContract = candidateTargetContract . TrimStart ( '/' ) ;
94- return candidateTargetContract ;
94+ return Uri . UnescapeDataString ( candidateTargetContract ) ;
9595 }
9696
9797 /// <summary>
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ protected virtual string GetContractFromNavigationContext(NavigationContext navi
125125
126126 var candidateTargetContract = UriParsingHelper . GetAbsolutePath ( navigationContext . Uri ) ;
127127 candidateTargetContract = candidateTargetContract . TrimStart ( '/' ) ;
128- return candidateTargetContract ;
128+ return Uri . UnescapeDataString ( candidateTargetContract ) ;
129129 }
130130
131131 /// <summary>
Original file line number Diff line number Diff line change @@ -232,4 +232,27 @@ public void ParseForDeepLinkRelativeUri()
232232 Assert . Equal ( _deepLinkRelativeUri , uri . OriginalString ) ;
233233 Assert . False ( uri . IsAbsoluteUri ) ;
234234 }
235+
236+ [ Theory ]
237+ [ InlineData ( "TestäöüView" ) ]
238+ [ InlineData ( "MøbëlList" ) ]
239+ [ InlineData ( "Ñoño" ) ]
240+ public void GetAbsolutePathUnescapesDiacritics ( string viewName )
241+ {
242+ var uri = UriParsingHelper . Parse ( viewName ) ;
243+ var absolutePath = UriParsingHelper . GetAbsolutePath ( uri ) ;
244+ var result = Uri . UnescapeDataString ( absolutePath . TrimStart ( '/' ) ) ;
245+ Assert . Equal ( viewName , result ) ;
246+ }
247+
248+ [ Theory ]
249+ [ InlineData ( "TestäöüView" ) ]
250+ [ InlineData ( "MøbëlList" ) ]
251+ public void GetUriSegmentsUnescapesDiacritics ( string viewName )
252+ {
253+ var uri = new Uri ( viewName , UriKind . Relative ) ;
254+ var segments = UriParsingHelper . GetUriSegments ( uri ) ;
255+ var segmentName = UriParsingHelper . GetSegmentName ( segments . Dequeue ( ) ) ;
256+ Assert . Equal ( viewName , segmentName ) ;
257+ }
235258}
You can’t perform that action at this time.
0 commit comments