NetTalk Central

Author Topic: NT12 apostophe in browse forms - solved  (Read 4071 times)

DonnEdwards

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Insights and Rants
    • Email
NT12 apostophe in browse forms - solved
« 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

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?
« Last Edit: June 13, 2021, 03:22:00 AM by DonnEdwards »
If you're happy with your security, then so are the bad guys

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: NT12 apostophe in browse forms
« Reply #1 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
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

DonnEdwards

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Insights and Rants
    • Email
Re: NT12 apostophe in browse forms
« Reply #2 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.
If you're happy with your security, then so are the bad guys

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: NT12 apostophe in browse forms
« Reply #3 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

DonnEdwards

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • Insights and Rants
    • Email
Re: NT12 apostophe in browse forms
« Reply #4 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
If you're happy with your security, then so are the bad guys