NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: DonnEdwards on June 10, 2021, 03:06:41 AM

Title: NT12 apostophe in browse forms - solved
Post 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?
Title: Re: NT12 apostophe in browse forms
Post by: DonRidley on June 11, 2021, 02:29:03 AM
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
Title: Re: NT12 apostophe in browse forms
Post by: DonnEdwards on June 11, 2021, 10:08:56 AM
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 &amp;apos; if I wanted to display the entity phrase instead of the actual entity character.

What does this mean?
Fix: Added &apos; to _jsok.
I suspect it may have something to do with the issue, but no idea what.
Title: Re: NT12 apostophe in browse forms
Post by: jking on June 12, 2021, 08:55:03 AM
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
Title: Re: NT12 apostophe in browse forms
Post by: DonnEdwards on June 13, 2021, 03:23:54 AM
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