pyActiveSync icon indicating copy to clipboard operation
pyActiveSync copied to clipboard

Question about handling of content after OPAQUE token

Open carsonip opened this issue 8 years ago • 0 comments

Question 1: From the code, I see

                if current_element.tag == "Mime":
                    opq_str = self.decode_string(opq_len)
                else:
                    import binascii
                    opq_str = binascii.hexlify(self.decode_binary(opq_len))
                current_element.text = opq_str

Is there a reason why MIME is handled differently? Is it documented somewhere (in official docs)?

Question 2: In the official C# code here:

                    case GlobalTokens.OPAQUE:
                        int CDATALength = bytes.DequeueMultibyteInt();
                        XmlCDataSection newOpaqueNode = xmlDoc.CreateCDataSection(bytes.DequeueString(CDATALength));
                        currentNode.AppendChild(newOpaqueNode);

It uses a CDATA section to contain contents after OPAQUE, but we are using text here. Is there a reason behind this implementation? Will this fail some edge cases?

Thank you very much.

carsonip avatar Oct 20 '17 03:10 carsonip