SyntaxEditor encoding issue with XML tooltips

SyntaxEditor for WPF Forum

The latest build of this product (v22.1.0) was released 1 month ago, which was before this thread was created.
Posted 18 days ago by Sascha Nitschke
Version: 13.2.0592
Platform: .NET 4.8
Environment: Windows 10 (64-bit)
Avatar

Hello Actipro,

I am working with the SyntaxEditor as XML Editor for a sound tool. The corresponding .xsd file contains annotations displayed as tooltips inside the SyntaxEditor.

<xs:attribute name="my_attribute" type="xs:string" use="required">
  <xs:annotation>
    <xs:documentation xml:lang="en-us">
      <!-- characters here -->
    </xs:documentation>
  </xs:annotation>-->
</xs:attribute>

There are four special chars. Using
- '♭' (flat) and '♯' (sharp) are ok but
- '𝄫' (double flat, &#119083;) and '𝄪' (double sharp, &#119082;) produce a System.Xml.XmlException:

"'☐', hexadecimal value 0xD834, is an invalid character.

Within the VS Xml Editor the tooltip will be displayed correctly and - of course - without exception.

Writing

SyntaxEditor.Document.LoadFile(xmlFile, Encoding.UTF8);
SyntaxEditor.Document.LoadFile(xmlFile, Encoding.Unicode);
SyntaxEditor.Document.LoadFile(fullXmlFileName, Encoding.GetEncoding("ISO-8859-1"));

do not work. Where is the mistake? Thank you :)

Regards
Sascha Nitschke

Comments (9)

Posted 16 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I just tried updating our Sample Browser's ProductSamples/SyntaxEditorSamples/Languages/XmlSchemas/Mammals.xsd file with &#119083; in the xs:documentation node for the main "mammal" element.  When I ran our XML Editor demo and hovered over the "mammal" tag, I saw the double flat ok.  This was done in the latest version.

Your original post mentions v13.2, which is almost 10 years old now.  Perhaps this was a bug that was fixed a while ago?  Can you try the latest version 22.1 to see if you still see the problem there?


Actipro Software Support

Posted 15 days ago by Sascha Nitschke
Avatar

Hello,

thank you for the quick response. Yes, my WPF Controls are very old but did their job over years. For me it was perfect. Until now! For hours I have tried to migrate to 22.1 (download from NuGet) but did not get it running. Meanwhile there are too many differences between both versions. In the future I will take more time and upgrade, migrade and (hopefully) celebrate.

Well, there is only one shi**y tooltip that does not work. I have to live with that issue for the next time ;).

Regards from Germany
Sascha Nitschke

Posted 15 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Sascha,

When you get back into upgrading, our conversion documentation should help.  If you run into an issue and can't find enough help in those docs, please feel free to write our support address with details of the problem, and we can assist.


Actipro Software Support

Posted 15 days ago by Sascha Nitschke
Avatar

Thank you for the link. I will take a look and see what I can do.

Apart from the tooltip issue I am really interested in the new WPF Controls incl. the SyntaxEditor addons: Awesome software!

Cheers
Sascha

Posted 10 days ago by Sascha Nitschke
Avatar

I have tested and crashed with Mammals.xsd. Wenn running SyntaxEditor as C# editor it works fine.

Is there a way to catch and handle the tooltip? Or is there another possible workaround?

[Modified 10 days ago]

Posted 9 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Sascha,

In your last post where you said you tested Mammals.xsd, do you mean you tested in the current v22.1 (where it seemed to work ok when we had previously tried) or v13.2?  If you tested v13.2 only, have you tried v22.1 yet?


Actipro Software Support

Posted 9 days ago by Sascha Nitschke
Avatar

Hello.

sorry, I am talking about version 13.2. I currently didn't test with 22.1 because I believe your explanations ;).

In Germany we say: "I don't need a cow if I just need a glass of milk". In this speacial case the "cow" is version 22.1, and the "glass of milk" is the tooltip. Is there a solution?

Regards
Sascha Nitschke

Answer - Posted 8 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

It looks like code was added in v16.1 that sets XmlReaderSettings.CheckCharacters to false and that's what resolves this issue.  Unfortunately it's deep in the codebase and there is no external workaround for v13.2 other than to not use those kinds of extended characters that would trigger the XmlException.  That's why I would suggest upgrading to v22.1 if possible.  I'm sorry we don't have an easy way to get you the glass of milk.


Actipro Software Support

Posted 8 days ago by Sascha Nitschke
Avatar

Hello,

ok, I see. You are right! In the near future it makes sense to upgrade to 22.1.

Thank you for your help :).

Regards
Sascha Nitschke

Add Comment

Please log in to a validated account to post comments.