In one of my apps, I am downloading an HTML file using HttpClient and then parse out the HTML code. This is working fine in most phones, including mine but certain users are reporting parse errors. When I looked into the HTML code on their devices, I realised what happened.
This is how the HTML code is supposed to be
But this is how some phones are returning it
Basically on those phones, the whole HTML code is in a single line without line breaks. But on my phone it contains line breaks and I can split those lines using Regex.Split(CRLF,html).
I download the file using HttpClient and read the contents in the following way
Since that returns this string without any line breaks, I also tried this
But the result is still the same. On certain phones the entire HTML source code is in a single line without line break. How can I convert it into normal form, from which I can split the lines using Regex.Split(CRLF,html)?
This is how the HTML code is supposed to be
B4X:
<select name=nDesign id="vote-rate-design" title="Design"><option>1</option><option>2</option><option>3</option><option>4</option><option selected>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select>
<select name=nFeatures id="vote-rate-features" title="Features"><option>1</option><option>2</option><option>3</option><option>4</option><option selected>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select>
But this is how some phones are returning it
B4X:
<select name=nDesign id="vote-rate-design" title="Design"><option>1</option><option>2</option><option>3</option><option>4</option><option selected>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select> <select name=nFeatures id="vote-rate-features" title="Features"><option>1</option><option>2</option><option>3</option><option>4</option><option selected>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select>
Basically on those phones, the whole HTML code is in a single line without line breaks. But on my phone it contains line breaks and I can split those lines using Regex.Split(CRLF,html).
I download the file using HttpClient and read the contents in the following way
B4X:
TextReader1.Initialize(File.OpenInput(File.DirInternalCache, "page.html"))
result=TextReader1.ReadAll
Since that returns this string without any line breaks, I also tried this
B4X:
result=File.ReadString(File.DirInternalCache, "page.html")
But the result is still the same. On certain phones the entire HTML source code is in a single line without line break. How can I convert it into normal form, from which I can split the lines using Regex.Split(CRLF,html)?