473,395 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do I find smart quotes?

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?

--
Sean.

Jul 10 '06 #1
3 6911

<Sean S - Perth>; "WA" <Se**********@discussions.microsoft.comwrote in
message news:B2**********************************@microsof t.com...
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.
--
Sean.

Jul 10 '06 #2

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:O3**************@TK2MSFTNGP05.phx.gbl...
>
<Sean S - Perth>; "WA" <Se**********@discussions.microsoft.comwrote in
message news:B2**********************************@microsof t.com...
>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.
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

>--
Sean.


Jul 18 '06 #3

"Mark J. McGinty" <mm******@spamfromyou.comwrote in message
news:ek**************@TK2MSFTNGP03.phx.gbl...
>
"Anthony Jones" <An*@yadayadayada.comwrote in message
news:O3**************@TK2MSFTNGP05.phx.gbl...

<Sean S - Perth>; "WA" <Se**********@discussions.microsoft.comwrote in
message news:B2**********************************@microsof t.com...
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.

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.
>
-Mark

--
Sean.



Jul 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Martin Goldman | last post by:
Hello all, I've been struggling for a few days with the question of how to convert "smart" (curly) quotes into straight quotes. I tried playing with the htmlentities() function, but all that is...
1
by: Max | last post by:
Anyone have a smart-quotes algorithm? Preferably in Java; python 2nd best; otherwise anything I can grok. Is there anything better (smarter) than: 1) if the previous character was...
11
by: Ron | last post by:
Hello, I'm having an aggravating time getting the "html" spewed by Word 2003 to display correctly in a webpage. The situation here is that the people creating the documents only know Word, and...
37
by: Ian Rastall | last post by:
I've been working on an online books site for almost four years now, and have been putting smart quotes in each book. This is a major hassle, and I'm beginning to think it's not worth it. Is...
3
by: red floyd | last post by:
I've got some code where somebody cut&pasted some comments from MS Word, and so these comments have "smart quotes" (in particular apostrophes) embedded. The apostrophe is character hex 0x92. ...
2
by: Adrian Smith | last post by:
Can anyone tell me how to get rid of smart quotes in html using Python? I've tried variations on stuff = string.replace(stuff, "\“", "\""), but to no avail, presumably because they're not standard...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.