How do I find smart quotes?

Discussion in 'ASP General' started by Sean S - Perth, WA, Jul 10, 2006.

  1. 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.
    Sean S - Perth, WA, Jul 10, 2006
    #1
    1. Advertising

  2. <Sean S - Perth>; "WA" <> wrote in
    message news:...
    > 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.
    >
    Anthony Jones, Jul 10, 2006
    #2
    1. Advertising

  3. "Anthony Jones" <> wrote in message
    news:...
    >
    > <Sean S - Perth>; "WA" <> wrote in
    > message news:...
    >> 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.
    Mark J. McGinty, Jul 18, 2006
    #3
  4. "Mark J. McGinty" <> wrote in message
    news:...
    >
    > "Anthony Jones" <> wrote in message
    > news:...
    > >
    > > <Sean S - Perth>; "WA" <> wrote in
    > > message news:...
    > >> 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.

    >
    >
    >
    Anthony Jones, Jul 21, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris White

    Quotes/Double Quotes in Image Control

    Chris White, Sep 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,828
    Hermit Dave
    Sep 22, 2004
  2. Chris
    Replies:
    1
    Views:
    13,601
    Oisin
    Mar 24, 2006
  3. Lawrence Tierney

    Multiline quotes - escaping quotes - et al

    Lawrence Tierney, Dec 24, 2003, in forum: Java
    Replies:
    3
    Views:
    4,480
    Andrew Thompson
    Dec 24, 2003
  4. jOhn
    Replies:
    1
    Views:
    209
    Phlip
    Jan 29, 2008
  5. Richard Sandoval
    Replies:
    5
    Views:
    188
    7stud --
    Apr 26, 2011
Loading...

Share This Page