Server.HtmlDecode("‘") does not work

Discussion in 'ASP .Net' started by emailmygroup@gmail.com, Sep 17, 2007.

  1. Guest

    I am trying to decode character &#145#; but it is not working. Anybody
    knows how to decode this character?
    , Sep 17, 2007
    #1
    1. Advertising

  2. What to you mean by decode. It's not coded.

    ‘ is an UTF-8 representation of the symbol.
    You can use Decoder utf8Decoder = Encoding.UTF8.GetDecoder();
    to work with it or convert to Unicode. But you will not fit it into ASCII
    table.


    George.



    <> wrote in message
    news:...
    >I am trying to decode character &#145#; but it is not working. Anybody
    > knows how to decode this character?
    >
    George Ter-Saakov, Sep 17, 2007
    #2
    1. Advertising

  3. bruce barker Guest

    what do mean by not working? it will creates a 1 char string with an
    ascii value of 145 (which is unprintable)


    -- bruce (sqlwork.com)


    wrote:
    > I am trying to decode character &#145#; but it is not working. Anybody
    > knows how to decode this character?
    >
    bruce barker, Sep 17, 2007
    #3
  4. Guest

    >From URL
    http://www.eggheadcafe.com/tutorial...74-9130-3210625e675c/html-entities-class.aspx

    I can say that ‘ is a printable character quote. Here is my
    program and its output

    Asc(Server.HtmlDecode("’")) ' Output = 63 = "?"
    Asc(Server.HtmlDecode("G")) ' Output = 71 = "G"
    Asc(Server.HtmlDecode("“")) 'Output = 63 ="?"

    146 represents single quote and 147 represents double quote. so my
    question is am I missing anything?
    , Sep 17, 2007
    #4
  5. re:
    !> 146 represents single quote and 147 represents double quote. so my
    !> question is am I missing anything?

    Yes, you are missing 145...

    What does Asc(Server.HtmlDecode("‘")) return ?




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    <> wrote in message news:...
    > >From URL

    > http://www.eggheadcafe.com/tutorial...74-9130-3210625e675c/html-entities-class.aspx
    >
    > I can say that ‘ is a printable character quote. Here is my
    > program and its output
    >
    > Asc(Server.HtmlDecode("’")) ' Output = 63 = "?"
    > Asc(Server.HtmlDecode("G")) ' Output = 71 = "G"
    > Asc(Server.HtmlDecode("“")) 'Output = 63 ="?"
    >
    > 146 represents single quote and 147 represents double quote. so my
    > question is am I missing anything?
    >
    >
    >
    >
    >
    Juan T. Llibre, Sep 17, 2007
    #5
  6. Guest

    Asc(Server.HtmlDecode("‘")) ' Output = 63 = "?"
    , Sep 17, 2007
    #6
  7. Guest

    can anybody help me???
    , Sep 18, 2007
    #7
  8. I *reaally* don't understand your question.

    When I process Server.HTMLDecode("‘")

    ....what I get as a result is : '

    See the sample at : http://asp.net.do/test/HTMLencode.aspx

    It's the LAST label in the list, after %3f ...and the code is :

    im txtenc2 as String = Server.HTMLDecode("‘")
    lblMessage6.Text = txtenc2

    It seems to render OK in that test. What is the problem you're seeing ?




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    <> wrote in message news:...
    > can anybody help me???
    >
    Juan T. Llibre, Sep 18, 2007
    #8
  9. Guest

    On Sep 18, 10:00 am, "Juan T. Llibre" <>
    wrote:
    > I *reaally* don't understand your question.
    >
    > When I process Server.HTMLDecode("‘")
    >
    > ...what I get as a result is : '
    >
    > See the sample at :http://asp.net.do/test/HTMLencode.aspx
    >
    > It's the LAST label in the list, after %3f ...and the code is :
    >
    > im txtenc2 as String = Server.HTMLDecode("‘")
    > lblMessage6.Text = txtenc2
    >

    When I write Server.HTMLDecode("‘") output is as follows

    Output: (not printable character so no output)
    length of string: 1
    Ascii value of character using Asc function: 63

    Do I need to change any settings anywhere? In my web.config file

    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />

    Thanks

    > It seems to render OK in that test. What is the problem you're seeing ?
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq :http://asp.net.do/faq/
    > foros de asp.net, en español :http://asp.net.do/foros/
    > ======================================
    >
    >
    >
    > <> wrote in messagenews:...
    > > can anybody help me???- Hide quoted text -

    >
    > - Show quoted text -
    , Sep 18, 2007
    #9
  10. wrote:
    > I am trying to decode character &#145#; but it is not working. Anybody
    > knows how to decode this character?
    >


    It's not working, because ‘ is not a valid html entity.

    According to all these sources, there is no html entity for character
    codes from 127 through 159:

    http://www.ascii.cl/htmlcodes.htm
    http://www.w3.org/MarkUp/html-spec/html-spec_13.html
    http://www.w3.org/TR/html4/sgml/entities.html

    You can use these htlm entities for quotes:

    &lsquo; ‘ left single quote
    &rsquo; ’ right single quote
    &sbquo; ‚ single low-9 quote
    &ldquo; “ left double quote
    &rdquo; ” right double quote
    &bdquo; „ double low-9 quote

    according to:
    http://www.webmonkey.com/reference/special_characters/

    --
    Göran Andersson
    _____
    http://www.guffa.com
    =?windows-1252?Q?G=F6ran_Andersson?=, Sep 18, 2007
    #10
  11. re:
    !> Do I need to change any settings anywhere? In my web.config file
    !> <globalization requestEncoding="utf-8" responseEncoding="utf-8" />

    I'm using :

    <globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" fileEncoding="iso-8859-1" />

    Can you test with those settings...and post back the result ?



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    <> wrote in message news:...
    On Sep 18, 10:00 am, "Juan T. Llibre" <>
    wrote:
    > I *reaally* don't understand your question.
    >
    > When I process Server.HTMLDecode("‘")
    >
    > ...what I get as a result is : '
    >
    > See the sample at :http://asp.net.do/test/HTMLencode.aspx
    >
    > It's the LAST label in the list, after %3f ...and the code is :
    >
    > im txtenc2 as String = Server.HTMLDecode("‘")
    > lblMessage6.Text = txtenc2
    >

    When I write Server.HTMLDecode("‘") output is as follows

    Output: (not printable character so no output)
    length of string: 1
    Ascii value of character using Asc function: 63

    Do I need to change any settings anywhere? In my web.config file

    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />

    Thanks

    > It seems to render OK in that test. What is the problem you're seeing ?
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq :http://asp.net.do/faq/
    > foros de asp.net, en español :http://asp.net.do/foros/
    > ======================================
    >
    >
    >
    > <> wrote in messagenews:...
    > > can anybody help me???- Hide quoted text -

    >
    > - Show quoted text -
    Juan T. Llibre, Sep 18, 2007
    #11
  12. re:
    !> It's not working, because ‘ is not a valid html entity.

    Goran, can you explain why the sample at :
    http://asp.net.do/test/HTMLencode.aspx works if ("‘") isn't valid ?

    Why would Server.HTMLDecode("‘") be translated to " ' " ?




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Göran Andersson" <> wrote in message news:u9AJC3h%...
    > wrote:
    >> I am trying to decode character &#145#; but it is not working. Anybody
    >> knows how to decode this character?
    >>

    >
    > It's not working, because ‘ is not a valid html entity.
    >
    > According to all these sources, there is no html entity for character codes from 127 through 159:
    >
    > http://www.ascii.cl/htmlcodes.htm
    > http://www.w3.org/MarkUp/html-spec/html-spec_13.html
    > http://www.w3.org/TR/html4/sgml/entities.html
    >
    > You can use these htlm entities for quotes:
    >
    > &lsquo; ‘ left single quote
    > &rsquo; ’ right single quote
    > &sbquo; ‚ single low-9 quote
    > &ldquo; “ left double quote
    > &rdquo; ” right double quote
    > &bdquo; „ double low-9 quote
    >
    > according to:
    > http://www.webmonkey.com/reference/special_characters/
    >
    > --
    > Göran Andersson
    > _____
    > http://www.guffa.com
    Juan T. Llibre, Sep 18, 2007
    #12
  13. Guest

    I changed web.config as following

    <globalization requestEncoding="iso-8859-1"
    responseEncoding="iso-8859-1" fileEncoding="iso-8859-1" />


    but no luck.
    , Sep 19, 2007
    #13
    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. Sonu Kapoor
    Replies:
    4
    Views:
    4,718
    Sonu Kapoor
    Oct 28, 2004
  2. Jonas Åkermark

    Server.HTMLDecode doesn't decode char 345

    Jonas Åkermark, Aug 2, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    792
    Joerg Jooss
    Aug 2, 2005
  3. Night Air

    Server.HtmlDecode Question

    Night Air, Jan 5, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    554
  4. mdh

    p 145 K&R

    mdh, Sep 1, 2008, in forum: C Programming
    Replies:
    14
    Views:
    621
  5. b.Wurm

    Server.HTMLDecode

    b.Wurm, Jun 7, 2005, in forum: ASP General
    Replies:
    3
    Views:
    230
    Steven Burn
    Jun 7, 2005
Loading...

Share This Page