Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:04:44+00:00 2026-05-29T09:04:44+00:00

I am reading a string from an xml file stored on the sdcard that

  • 0

I am reading a string from an xml file stored on the sdcard that has some carriage returns stored with the “\n” escape sequence. Such as

<string mystring="Line1\nLine2">

But when I display the text in the emulator, the \n is showing up instead of making a newline. I am not doing anything unusual with the text–just reading it with a SAXParser and then adding it to a textview. Is there a setting I need to check to make sure newlines are rendered correctly? Do I need to store the carriage returns differently in the xml file?

I have also tried \r\n and that doesn’t work either.
When I debug, I can see that an extra \ is placed in front of the existing \
I see that in my SAX startElement method, the line

String s = atts.getValue("mystring");

assigns “Line1\nLine2” to s, so the problem is with the SAXParser.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:04:45+00:00Added an answer on May 29, 2026 at 9:04 am
    &#xA;
    

    works very well in the middle of a quoted textview. I’d like to add that in Eclipses’ graphic viewer it puts in an extra space (like it is double spaced). When it is compiled however and you run it on the emulator or a device, you only have the carriage return. So, trust MrGibbage and you’ll save yourself some time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the 2 following methods of reading a string from a file: NSString *path
Using Python, how would I go about reading in (be from a string, file
Im having trouble reading from a CSV file final String DELIMITER = ,; Scanner
I am reading an xml file and want to perform string operations on the
I'm reading an XML file from a REST web service, parsing it, and displaying
I'm having troubles reading values from an xml file. Here is the xml file:
I'm reading configuration from an xml file. I have a property called linkType in
I'm writing a date/time value to an XML file by reading the date from
I am reading data from an XML file then converting the data from Strings
I am writing a date in xml file & then reading a date from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.