www.webdeveloper.com
Results 1 to 3 of 3

Thread: Apostrophe's in strings

  1. #1
    Join Date
    Jun 2012
    Posts
    58

    Apostrophe's in strings

    I have an issue where I pull values from a database. The values have apostrophe's in them but when they are displayed on the page the string stops at the apostrophe (i.e. today's is displayed as today).

    How can I get the entire string to be displayed?

    Here is where I am displaying the string:
    Code:
    <h1 class='tabletitle'><%=rs("FloorName")%>&nbsp;(<%=dspLayoutName%>)</h1>
    Thanks for your help.

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,270
    Use the functions addcslashes() and stripslashes() with PHP or, with uft-8 charset, replace all apostrophes with the typographic apostrophe (’) with this code
    Code:
    $strWithTypeSetApostrophe=str_replace(chr(39),'’',$str);
    This typeset apostrophe is obtain with alt 0146.

  3. #3
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    I'm having numerous brain cramps here.

    First, if you're outputting unescaped apostrophes, then the problem you should be facing is XSS, not truncated strings. Second, those look like ASP tags, so PHP advice probably won't help. And third, the one thing I definitely don't see is JavaScript, yet you posted in a JavaScript forum.

    You should probably be posting in the ASP or .NET forums, and you'll probably need to provide a lot more detail.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles