You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using PNP-CopyFile we have noticed that is a SharePoint page has emoticons (using Encoded values) the page copy fails and produces the error below:
Action 'Copy_Page' failed: The surrogate pair (0xD83D, 0xD83D) is invalid. A high surrogate character (0xD800 - 0xDBFF) must always be paired with a low surrogate character (0xDC00 - 0xDFFF). CallStack -- at System.Xml.XmlTextEncoder.Write(String text) at System.Xml.XmlTextWriter.WriteString(String text) at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope) at Microsoft.SharePoint.Deployment.XmlFormatter.WriteArray(Object array, String name, Type objectType) at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope) at Microsoft.SharePoint.Deployment.XmlFormatter.Serialize(Stream serializationStream, Object topLevelObject) at Microsoft.SharePoint.Deployment.SPExport.SerializeObjects() at Microsoft.SharePoint.Deployment.SPExport.Run() clientRequestId: --- serviceRequestId: --- "It seems that the error occurred due to a problem with the file being copied in the 'Copy Page' operation. The error message indicates an issue with the surrogate pair in the file content. To fix this, check the content of the source file '/SitePages/pension.aspx' to ensure it does not contain any invalid characters or encoding issues that could cause the copy operation to fail."
Is this a known issue and is there a workaround for it when using PNP-Copy?
Which operating system/environment are you running PnP PowerShell on?
This discussion was converted from issue #4159 on August 14, 2024 19:20.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using PNP-CopyFile we have noticed that is a SharePoint page has emoticons (using Encoded values) the page copy fails and produces the error below:
Action 'Copy_Page' failed: The surrogate pair (0xD83D, 0xD83D) is invalid. A high surrogate character (0xD800 - 0xDBFF) must always be paired with a low surrogate character (0xDC00 - 0xDFFF). CallStack -- at System.Xml.XmlTextEncoder.Write(String text) at System.Xml.XmlTextWriter.WriteString(String text) at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope) at Microsoft.SharePoint.Deployment.XmlFormatter.WriteArray(Object array, String name, Type objectType) at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope) at Microsoft.SharePoint.Deployment.XmlFormatter.Serialize(Stream serializationStream, Object topLevelObject) at Microsoft.SharePoint.Deployment.SPExport.SerializeObjects() at Microsoft.SharePoint.Deployment.SPExport.Run() clientRequestId: --- serviceRequestId: --- "It seems that the error occurred due to a problem with the file being copied in the 'Copy Page' operation. The error message indicates an issue with the surrogate pair in the file content. To fix this, check the content of the source file '/SitePages/pension.aspx' to ensure it does not contain any invalid characters or encoding issues that could cause the copy operation to fail."
Is this a known issue and is there a workaround for it when using PNP-Copy?
Which operating system/environment are you running PnP PowerShell on?
Windows
Beta Was this translation helpful? Give feedback.
All reactions