ASCII character substitution when using the K2.net SharePoint client event to upload documents to SharePoint

  • 16 February 2021
  • 0 replies
  • 4 views

Userlevel 3
Badge +8
 

ASCII character substitution when using the K2.net SharePoint client event to upload documents to SharePoint

KB000097

PRODUCT
K2.net 2003
TAGS
Microsoft SharePoint
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

When the SharePoint 2003 Document Event Template is used to upload documents to SharePoint and an XML Field is used as the source for document to be uploaded, then characters with an ASCII value above 128 will be replaced by a question mark character [?]. This is because the code generated by the SharePoint 2003 Document Server Event Template uses ASCII encoding.

 

When the SharePoint 2003 Document event template is used to upload documents to SharePoint and an XML Field is used as the source for document to be uploaded, then characters with an ASCII value above 128 will be replaced by a question mark character [?]. This is because the code generated by the SharePoint 2003 Document server event template uses ASCII encoding.

To correct this make the following code change in the SharePoint 2003 Document server event template code. Replace the line of code that says:

 

oByte = System.Text.ASCIIEncoding.ASCII.GetBytes(K2.ProcessInstance.XmlFields["K2InfoPathSchema"].Value);

 

With these two lines:

 

System.Text.UTF8Encoding oTextEncoder = new System.Text.UTF8Encoding();
oByte = oTextEncoder.GetBytes(K2.ProcessInstance.XmlFields["K2InfoPathSchema"].Value);

 

 
Download:
 
 

 


0 replies

Be the first to reply!

Reply