Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
elanorb
- Livecode Staff Member
- Posts: 516
- Joined: Fri Feb 24, 2006 9:45 am
Post
by elanorb » Thu Apr 22, 2021 4:22 pm
Hi Albert
After doing some testing I think the issue might be related to line endings.
HTML5TestReport.txt has Windows line endings(CR and LF). HTML5TestReportDownAndUp.txt had Unix line endings(LF).
Changing the line endings in HTML5TestReport.txt using a text editor or by doing
Code: Select all
replace numToChar(13) with empty in <text data>
in LiveCode allowed me to create a new version of the file that could be loaded into a field in an HTML5 app.
I have reported a bug
https://quality.livecode.com/show_bug.cgi?id=23178
You can see my test app here
https://elanorb.on-rev.com/techsupport/ ... eTest.html
I hope that helps. Please let me know if that works for you.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
-
AlbertAA
- Posts: 41
- Joined: Thu May 28, 2020 1:42 pm
Post
by AlbertAA » Fri Apr 23, 2021 5:04 pm
Yes. By replacing "return" with an empty space the HTML5 standalone works (it loads the file).
I tried with a file created by a LC stack containing only "line 1 & return & "line 2". If I put the file on the server the HTML5 standalone blocks.
To make it work I tested producing the file under Windows (the report files I store can be actually produced on both platforms, depending on where my app is running) - I had to use:
replace numToChar(10) with "" in theData
because replacing numToChar(13) was not doing the job. I think that I will have to distinguish between platforms before making the replace.
Now that the loading issue has been clarified and resolved, my remaining "problem" is that by substituting "return" with "empty" the file does not display correctly in a browser anymore (all linefeeds are lost). Besides that the HTML5 standalone is now able to do what I expected.
thank you again
-albert
-
bogs
- Posts: 5435
- Joined: Sat Feb 25, 2017 10:45 pm
Post
by bogs » Fri Apr 23, 2021 7:05 pm
AlbertAA wrote: ↑Fri Apr 23, 2021 5:04 pm
Now that the loading issue has been clarified and resolved, my remaining "problem" is that by substituting "return" with "empty" the file does not display correctly in a browser anymore (all linefeeds are lost).
I wonder what would happen if you replaced the returns with "<br>" instead of empty...
-
AlbertAA
- Posts: 41
- Joined: Thu May 28, 2020 1:42 pm
Post
by AlbertAA » Fri Apr 23, 2021 10:03 pm
Good idea. I tried it.
After the replace the file generated looks again good in a browser, but unfortunately the HTML5 Standalone cannot load it and gets stuck. Really does not seem to appreciate/digest well text including return or <br>. I'll end up replacing my returns with "HTML5StandaloneCompatibleLinefeed"
-
AlbertAA
- Posts: 41
- Joined: Thu May 28, 2020 1:42 pm
Post
by AlbertAA » Mon Apr 26, 2021 11:51 pm
For your info I found out that other Text files that I was producing crashed when loading with the HTML5 standalone even after replacing return (numToChar(10))
They started working again after I replaced another character which blocked the loading in the HTML5 standalone:
replace numToChar(146) with numToChar(39) in thetrace
Apostrophes ...
Hope this helps
-albert
-
elanorb
- Livecode Staff Member
- Posts: 516
- Joined: Fri Feb 24, 2006 9:45 am
Post
by elanorb » Tue Apr 27, 2021 3:30 pm
Thanks Albert, I have added this to the bug report.
Elanor
Elanor Buchanan
Software Developer
LiveCode
-
AlbertAA
- Posts: 41
- Joined: Thu May 28, 2020 1:42 pm
Post
by AlbertAA » Tue Apr 27, 2021 7:51 pm
... and by the way numToChar(147) stopped me too.
One has to be careful with Apostrophes, but also with different types of Quotation marks. Unless this is kind of "obvious" for most people, users should be at least informed. Thank you for following this up.
-
jacque
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
-
Contact:
Post
by jacque » Wed Apr 28, 2021 5:39 pm
Could this be a conflict between UTF8 and UTF16?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com