How do I find smart quotes?

S

Sean S - Perth, WA

Hi all,

I'm wondering if there is a way to find (to strip or process) smart quotes
in text submitted via a form?

These don't work:

strOutput = Replace(strOutput, "“", "“") ' left smart quote char as
replace value
strOutput = Replace(strOutput, Chr(147), "“") ' my best guess at where the
left smart quote char is in the charset

I guess the real question is if I submit the page as Unicode is there a way
to process it as cp-1252?
 
A

Anthony Jones

Hi all,

I'm wondering if there is a way to find (to strip or process) smart quotes
in text submitted via a form?

These don't work:

strOutput = Replace(strOutput, """, """) ' left smart quote char as
replace value

The reason you can't create a string literal containing a smart quote
because it is treated as a double quote.
strOutput = Replace(strOutput, Chr(147), """) ' my best guess at where the
left smart quote char is in the charset

I guess the real question is if I submit the page as Unicode is there a way
to process it as cp-1252?

All Strings in VBScript are unicode. Windows-1252 chars 147 and 148 in
unicode are 8220 and 8221.


 
M

Mark J. McGinty

Anthony Jones said:
The reason you can't create a string literal containing a smart quote
because it is treated as a double quote.


All Strings in VBScript are unicode. Windows-1252 chars 147 and 148 in
unicode are 8220 and 8221.

All strings in VBS may be Unicode, but ASP will not process source files
saved as Unicode; therefore, by definition, a conversion from ANSI to
Unicode must be performed on all string literals...

Does anyone else wonder how an environment that claims Unicode as its native
string type, could be unable to handle Unicode source?


-Mark

 
A

Anthony Jones

Mark J. McGinty said:
All strings in VBS may be Unicode, but ASP will not process source files
saved as Unicode; therefore, by definition, a conversion from ANSI to
Unicode must be performed on all string literals...

But UTF-8 works fine ;)
Does anyone else wonder how an environment that claims Unicode as its native
string type, could be unable to handle Unicode source?

Because:-

1) UTF-8 works fine so there is no pressing need to support 2 byte unicode
characters.
2) The parser goes way way back and is based on pure ASCII single byte
characters forming the keywords for the tokens it creates.

Anthony.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top