# escapeIllegalXmlChars

**URL:** <https://forum.juce.com/t/escapeillegalxmlchars/1763>\
**Category:** General JUCE discussion\
**Created:** [June 6, 2007, 8:18am UTC](https://forum.juce.com/t/escapeillegalxmlchars/1763 "2007-06-06T08:18:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ioue](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ioue/32/127_2.png) [@ioue](https://forum.juce.com/u/ioue)\
**Post date:** [June 6, 2007, 8:18am UTC](https://forum.juce.com/t/escapeillegalxmlchars/1763/1 "2007-06-06T08:18:33Z")

</div>

Hi,

I’m tring to save a xml document.  
There are multi-byte strings in the doc.

In that case, these string are translated like &#foo; by escapeIllegalXmlChars.

The third argment of the XmlElement::writeToFile is encoding type.  
But I think this implement ignores the encoding-type absolutely.

Best regards,  
ioue

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 6, 2007, 10:20am UTC](https://forum.juce.com/t/escapeillegalxmlchars/1763/2 "2007-06-06T10:20:37Z")

</div>

It does ignore the encoding type at the moment (it’s just there to let you specify what string goes in the document header), but should write it correctly as utf8. Are you saying the utf8 is wrong?

---

<div class="post-metadata">

**Author:** ![ioue](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ioue/32/127_2.png) [@ioue](https://forum.juce.com/u/ioue)\
**Post date:** [June 6, 2007, 11:02am UTC](https://forum.juce.com/t/escapeillegalxmlchars/1763/3 "2007-06-06T11:02:17Z")

</div>

Centainly these strings are collectly escaped.  
But they are not human-readable…  
I think these characters have not to be escaped. They are not illegal.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 6, 2007, 11:20am UTC](https://forum.juce.com/t/escapeillegalxmlchars/1763/4 "2007-06-06T11:20:24Z")

</div>

Not all editors might cope with them correctly though - that’s why it escapes them for safety. I see your point though, I’ll have a think about it.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 12, 2017, 7:50pm UTC](https://forum.juce.com/t/escapeillegalxmlchars/1763/5 "2017-05-12T19:50:45Z")

</div>

Closed on May 12, 2017, 7:50pm UTC


