NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: DonnEdwards on June 10, 2021, 03:06:41 AM
-
I noticed some bad punctuation in some of my imported data, so I ran a filter using StringTheory to remove any strange characters:
stname.SetValue(stline.GetLine(12)) ! STRING(200) !Section Name
stname.replace('"','') ! Remove extra quotes in data
stname.replace('`','''') ! fix bad punctuation
stname.replace('\','/') ! fix bad punctuation
stname.KeepChars('0123456789 .,''&ABCDEFGHIJKLMNOPQRSTUVWXYZ-/:;!@#$%^&*()+?') ! Remove weird data
stname.replace(',',', ') ! fix bad punctuation
stname.replace(' ',' ') ! fix bad punctuation
mp:section_name = CLIP(LEFT(stname.GetValue()))
All the text data is in upper case. If I look at it in a Clarion ABC app, the attached image 1 shows the data as it appears in the tables.
If I display the same TPS file in a NT web server browse form, I get the second image. Wherever there is a normal apostophe (Character 39) it is displayed as ', which is weird because HTML is supposed to regard this as an HTML Entity (https://www.w3schools.com/html/html_entities.asp)
I have to restrain myself from editing ATTORNEY'S to the correct ATTORNEYS but that's another matter :-) Also, the "Change" form doesn't show the ', only the browse form.
So what is going on? How do I fix it? Is this a bug in NT 12.19 or have I broken something?
-
Looks like the server is converting the character to an HTML entity.
I wonder if you could do a stname.Replace(''','<39>') instead of stname.replace('`','''') if it take care of it.
You may have to do it at runtime in the NT browse when it creates that cell.
Good luck,
Don
-
Looks like the server is converting the character to an HTML entity.
What I don't understand is why the entity is not displayed correctly. It only does it with the apostrophe, but not the ampersand?
Normally a browser would expect &apos; if I wanted to display the entity phrase instead of the actual entity character.
What does this mean?
Fix: Added ' to _jsok.
I suspect it may have something to do with the issue, but no idea what.
-
Donn,
I see something similar in my NT 12.19 browses. I solved it by setting the "Allow xHTML in column" check box on the column tab. See attached image.
Thanks,
Jeff
-
I solved it by setting the "Allow xHTML in column" check box on the column tab.
Jeff, you're a star! Thank you very much. My understanding of NT forms has also grown.
Best wishes
Donn