• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

how to interpret a carriage return

Ok I have an XML file I'm reading through some XML library. It has got some tags like:

<something> Some text inside of here Some more text that belongs on a new line </something>

I get the string in my c++ app and I'm trying to render it now in a win32 multiline edit control.

I want to put a line break in that sentence, but store it in the XML file so when I render the string it comes out like:

Some text inside of here
Some more text that belongs on a new line

What do I need to put in the XML document for it to interpret the carriage return?

Thanks!
0
minnirok
Asked:
minnirok
1 Solution
 
jkrCommented:
Use the XML encoding for '\r\n' which is '&#xd;&#xa;', i.e.:

Some text inside of here&#xd;&#xa;Some more text that belongs on a new line
0
 
grg99Commented:
it's not a great idea to put fixed length line breaks in.

What if:

(1)  The user switches the screen to 640x480 mode?  Or 2048x 1760?

(2)  They select "Use large fonts"

(3)  They select "33 dpi" or "120 dpi".

(4)  They change the default system font to 32-point Agamemnon-Italic?

0
 
minnirokAuthor Commented:
Agreed, but I just need to put the breaks in for now,

Thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now