Return to Website

Welcome to the Austin Seven Friends web site and forum

To get a quick overview of all the messages click on

" Switch to Threaded style "

Forum: Welcome Austin seven Friends
Start a New Topic 
   Board|Threaded
Author
Comment
View Entire Thread
Re: Those characters

Jim

It is related to the way in which PHP and the database handling the forum encodes quotes.

Lets say that the string (text) that you want to put in your database is terminated by a single quote ', but the text also contains a single quote - say 'I wanted to write this in the forum but i'm afraid it won''t work'

In this case, the extra single quotes will cause the string (text) to be terminated prematurely. What is needed is an escape character (\).

Before each single quote ', the escape character is used to identify that the ' should be included within the string.

What SHOULD happen is that the ' is encoded before transmission to the server (see http://www.utexas.edu/learn/html/spchar.html) and then before the string is sent to the database, the encoded characters are changed to real ones and then the escape character is added. The database should strip out the escape character. Where the \ character is used in the post, a double \\ is used (to escape the escape character). If the post is edited, the single quotes shouldn't need to be used, so when submitted

What appears to be happening is that the escape characters are either not being stripped properly from the string, or they are being added. This means that when a post is edited, additional escape characters are added to escape each of the escape characters - and so on, which is why they seem to propagate!

Hope this makes sense

Peter

Email  
Re: Those characters - by Jim Holyoake - Jul 15, 2014 8:48am
Re: Those characters - by Peter Clayton - Jul 15, 2014 9:09am
Re: Those characters - by Sandy Croall - Jul 15, 2014 10:15am
Re: Those characters - by Geoff Halstead - Jul 15, 2014 10:49am
Re: Those characters - by Peter Johnson - Jul 15, 2014 12:12pm
Re: Those characters - by Geoff Halstead - Jul 22, 2014 11:34am
Re: Those characters - by Sandy Croall - Jul 22, 2014 4:30pm
Re: Those characters - by Geoff Halstead - Jul 23, 2014 11:12am