Android Question Test formatting issues

siddsg

Member
Licensed User
Longtime User
Hello,
I am facing some text formatting issues.

Issue 1:
I have imported data into a SQLITE db by the following procedure:
1. Entered text into an excel sheet with the formatting I wanted.
2. Covnert that into a csv.
3. Import into an existing SQLITE table. However, I see all the formatting is gone.

For eg:
This is the Header Line:
1. Detail Line One
2. Detail Line Two

This shows up in my app as:
This is the Header Line: 1. Detail Line One 2. Detail Line Two

Issue 2:
Apostrophe shows up as a ? in the app.

For eg:
- Thread's shows up as.....Thread?s

Has anyone faced these issues and knows how to solve them?
Thanks you!
Siddharth
 

rbsoft

Active Member
Licensed User
Longtime User
The apostrophe is used as an delimiter for text fields in SQLite. If you want to insert a value with an apostrope then you should reformat it this way, that you duplicate the apostrophe:

Value: 'Threads's' should become 'Thread''s'

See also here:
http://www.sqlite.org/faq.html#q14

Rolf
 
Upvote 0

siddsg

Member
Licensed User
Longtime User
Thank you! The apostrophe issue got solved. Still working on the other one!
 
Upvote 0

siddsg

Member
Licensed User
Longtime User
When you save a CSV file with Microsoft Excel it saves it in ASCII format. It doesn't support non-ASCII characters.

You can open the text file with a text editor such as Notepad++ to see the saved values.
Hi Erel,
Sorry for the late reply...have been toggling projects.
I found that the data is importing correctly into the database....because when I do a copy from the result of the select query, it shows me with the formatting that I want.
So I guess the issue is somewhere in my code.
I am placing the data into a Webview by using the following line....

B4X:
WebViewDisplay.LoadHtml(DBUtils.ExecuteHtml(SQL1, "SELECT Question FROM QueriesTable where Qry_Id = " & Query_Id, Null, 0, False))

In the Webview, the formatting is gone and everything shows in a single line.
 
Upvote 0
Top