File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/WorkItemMigrator/Migration.WIContract Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ private WiItem LoadFile(string path)
3232 serialized = Regex . Replace ( serialized , @"\\\\u[0-F]{4,}" , "" ) ;
3333 }
3434
35+ serialized = serialized . Replace ( "\\ u001b" , "\n " ) ; // Clean up Unicode escape characters
36+
3537 var deserialized = JsonConvert . DeserializeObject < WiItem > ( serialized , new JsonSerializerSettings ( ) { NullValueHandling = NullValueHandling . Ignore } ) ;
3638
3739 foreach ( var rev in deserialized . Revisions )
@@ -59,7 +61,9 @@ public IEnumerable<WiItem> EnumerateAllItems()
5961 }
6062 catch ( Exception )
6163 {
62- Logger . Log ( LogLevel . Warning , $ "Failed to load '{ Path . GetFileName ( filePath ) } ' (perhaps not a migration file?).") ;
64+ Logger . Log ( LogLevel . Warning , $ "Failed to load '{ Path . GetFileName ( filePath ) } ', possible reasons:\n " +
65+ $ "- Perhaps not a migration file?\n " +
66+ $ "- Perhaps the file contains unhandled Unicode sequences (e.g. \\ u1234, \\ uXXXX) or non-unicode characters? Invalid characters must be stripped.") ;
6367 }
6468 }
6569 return result ;
You can’t perform that action at this time.
0 commit comments