Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1472 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     .NET and MSSQL :

Escaping a " in Classic ASP?

Thread title: Escaping a " in Classic ASP?
Reply    
    Thread tools Search this thread Display Modes  
05-10-2011, 09:07 PM
#1
jimmykup is offline jimmykup
Status: I'm new around here
Join date: Apr 2010
Location:
Expertise:
Software:
 
Posts: 11
iTrader: 0 / 0%
 

jimmykup is on a distinguished road

  Old  Escaping a " in Classic ASP?

Hi everyone,

I'm trying to search for a single instance of a " in my text, and then replace it with it's HTML entity code. For example, I want 17.8" Inches to become 17.8> Inches in my source code. Here's the code I'm using below.

Unfortunately, this doesn't work because searching for a " within the two " " just doesn't work. Is there a workaround for this? Any help would be greatly appreciated!

05-10-2011, 09:39 PM
#2
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

A quick google search (asp classic escaping) found this: http://www.plus2net.com/asp-tutorial/escape.php

Also, if you have a choice don't use ASP, it has been depreciated for years. If you are windows move to .NET, it is better in every way.

Reply With Quote
05-11-2011, 08:17 PM
#3
jimmykup is offline jimmykup
Status: I'm new around here
Join date: Apr 2010
Location:
Expertise:
Software:
 
Posts: 11
iTrader: 0 / 0%
 

jimmykup is on a distinguished road

  Old

Thanks for the reply.

That page discusses how to write a double quote to the screen. Unfortunately it doesn't work for my case. Here's the code I'm using.

Code:
strOutput = Replace(strOutput, "chr(34)", """)
This does not work for me. For whatever reason the ASP fails to find the double quote when it searches for "chr(34)" as that site suggests using. Just seems like "chr(34)" doesn't work for a find and replace because it's looking for "chr(34)" when in it should really just be looking for a " .

Any ideas?

Also, trust me, I'd prefer to not work in ASP. Unfortunately that's what I'm stuck with at my job. They're moving to .NET but it's taking a while.

Reply With Quote
05-11-2011, 11:13 PM
#4
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Take chr(34) out of the quotes. Its been so long since I've worked in ASP I've forgotten many of its annoyances so I'm just guessing right how.

Reply With Quote
05-13-2011, 03:28 PM
#5
jimmykup is offline jimmykup
Status: I'm new around here
Join date: Apr 2010
Location:
Expertise:
Software:
 
Posts: 11
iTrader: 0 / 0%
 

jimmykup is on a distinguished road

  Old

Score! That did the trick.

Thank you!

Reply With Quote
Reply    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed