none
Hyphen getting saved as illegal character in xml file RRS feed

  • Question

  • My input has Hyphen like Cloud license and on-premise license but it is saved in xml like below screen shot. a illegal character is there.

    when saving this text in xml then a illegal character is saving instead of Hyphen. so please advise me how to prevent to save illegal character in xml file? and Hyphen should be always as Hyphen in xml file instead of illegal character.

    please advise. thanks

    Friday, September 18, 2020 5:16 PM

All replies

  • There are several kinds of legal hyphens and dashes.

    Consider an encoding, such as UTF-8, which can save the character.

    Use a viewer and font that can represent the character. (Maybe it is a problem of the program which was used to view the contents; or an improper encoding or code page was selected).

    Show the fragment that saves this XML.

    If possible, try determining the numeric code of this hyphen from the source string before it is saved to file.

    Saturday, September 19, 2020 4:13 AM
  • Please tell me some one said this forum is going to close. if yes then how could i get all my old post if this forum is going to shut down?

    i posted lots of my questions in this forum and also got a good answer too. so i want to preserve all those questions and answers. please tell me preserve all my old post in this forum?

    please guide me. thanks

    Saturday, September 19, 2020 8:04 AM
  • Please tell me some one said this forum is going to close. if yes then how could i get all my old post if this forum is going to shut down?

    i posted lots of my questions in this forum and also got a good answer too. so i want to preserve all those questions and answers. please tell me preserve all my old post in this forum?

    please guide me. thanks

    You know, Sudip ... that's a great question!!  

    The closed MSDN Forums are still supposed to remain "open" for viewing old questions/replies. But you won't be able to edit or reply to any of the old posts. It will be read-only. The whole Data Platform Development Forum is not closing, but individual topics in this forum apparently are are (such as this XML topic) 

    However, if you go the new Q&A Forum here: https://docs.microsoft.com/en-us/answers/products/ and look for a forum specifically about XML, you won't find it. As far as I can tell, there isn't anything like that (specific topic dedicated to XML) on Q&A. In fact, there is not even a Data Platform Development forum anywhere to be found. Instead, if you want to find questions about XML, you have just use XML in a search. There are Tags you can use for your searches as well (to see all questions related to a specific tag) ... but guess what? There isn't an XML tag.

    I'm probably supposed to like this new Q&A Forum, because I'm an MVP ... but, I'll be truthful here. I DO NOT like it at all. I think it's very hard to use. I think I gave some feedback early on about it, but it obviously did not help.


    ~~Bonnie DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com

    Monday, September 21, 2020 12:54 AM
  • Madam one day this forum will be closed and people will not be able to see their old post. so guide me how could i backup for my all old post if possible then the advantage will be if MS close this forum then my may be able to see my old post from backup. waiting for your further guide lines. thanks
    Monday, September 21, 2020 7:51 AM
  • Sorry, Sudip ... I have no idea how you could easily back up your old posts.  =0(  

    ~~Bonnie DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com

    Monday, September 21, 2020 2:04 PM
  • The given sample does not contain an illegal character. 

    An illegal character is only possible, when you use a charset which does not support it.

    The common default charset for XML is, if not specified, UTF-8. Thus the character is in most scenarios valid.

    It looks like you've copied the XML fragment and used an tool (editor) which uses a different charset then the source or your operating system has no font to display the character. Both is annoying, but bot an error.

    Thus, please rephrase your question and provide more context about your use-case.

    Where does the data come from? Who does the XML document look like? What charsets are defined to be used? 

    Monday, September 21, 2020 2:34 PM