Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • While it's easier, I'd still recommend using a proper XML library just so you don't need to worry about escaping things. If you get it wrong, people will have issues trying to consume your XML somewhere down the track when some edge case crops up. Commented Mar 14, 2011 at 6:15
  • @Matthew would saving the file in correct encoding be an issue? does encoding differ in Linux environment Commented Mar 14, 2011 at 6:24
  • @AdityaGameProgrammer I'm not a C++ programmer so I can't answer that one for you sorry. That said, encodings are another tricky issue, one that should be transparent and not an issue if you use a proper library. Commented Mar 14, 2011 at 6:26
  • 1
    @AdityaGameProgrammer: Line endings work just like any other text file on Windows vs. Linux. Encodings like UTF-8 vs. ISO-8859-1 or whatever are handled similarly, though I would suggest there's little reason to encode XML files in anything but UTF-8. Commented Mar 14, 2011 at 8:35
  • @Dean Harding: I would suggest writing a small framework around it still. Just to make sure that escaping is done correctly and tags get closed properly... Might as well use a simple library at that point ? Oh and by the way, don't use endl all over the place. Commented Mar 20, 2011 at 19:54