locked
The surrogate pair (0xD993, 0x2A0) is invalid. A high surrogate character (0xD800 - 0xDBFF) must always be paired with a low surrogate character (0xDC00 - 0xDFFF) RRS feed

  • Question

  • User-791832538 posted

    I want to serialize something in unicode language (persian) in xml file (<?xml version="1.0" encoding="utf-8"?>). In fact i try to use SEARCHAROO7 codes from (www.searcharoo.net) for searching in doc/docx and pdf files. it works for a limited number of files. but it causes this error (The surrogate pair (0xD993, 0x2A0) is invalid. A high surrogate character (0xD800 - 0xDBFF) must always be paired with a low surrogate character (0xDC00 - 0xDFFF)) for a large number of files. i tested it to realize if some files have problems with unicode, but i found out that there is no problem for each file alone.

    please tell me how i fix it.

    Tuesday, December 28, 2010 2:32 AM

All replies

  • User-1635004338 posted

    Hi ironazar,

    Here are some possible solutions about this error. Hope them help:

    http://forums.devx.com/showthread.php?t=165694

    http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/05ff7a89-3192-4d5e-a62c-04add46be656/

    Thanks,

    Thursday, December 30, 2010 3:26 AM
  • User-791832538 posted

    Hi Dian


    I had visited those links before my post. But i did not get any result.


    Thanks a lot.

    Sunday, January 2, 2011 3:28 AM
  • User-1635004338 posted

    Hi ironazar,

    It is hard for me to solve the issue. I think it is encoding issue. Try something else for encoding the Persian.

    Thanks,

    Sunday, January 2, 2011 8:30 PM
  • User-1680709272 posted

    The error message is very specific: those two values -- 0xD993 and 0x2A0 -- are not a valid combination. In UTF-16, all characters are either one or two sets of double-byte codes. Surrogate Pairs are the two sets of double-byte codes that map the Supplementary Characters. And, as the error message states, those Surrogate Pairs can only be made up of certain combinations of those double-byte codes.

    However, the 0x2A0 code seems like bad data in the first place since it is technically 1.5 bytes, unless it is supposed to represent 0x2A00. Of course, even if the error message has a display issue and the actual value really is 0x2A00, that is still an invalid Surrogate Pair sequence.

    Saturday, November 28, 2015 6:01 PM