Server.HtmlDecode("‘") does not work


E

emailmygroup

I am trying to decode character &#145#; but it is not working. Anybody
knows how to decode this character?
 
Ad

Advertisements

G

George Ter-Saakov

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

bruce barker

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)
 
J

Juan T. Llibre

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 ?
 
Ad

Advertisements

J

Juan T. Llibre

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 ?
 
E

emailmygroup

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
 
?

=?windows-1252?Q?G=F6ran_Andersson?=

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/
 
J

Juan T. Llibre

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 ?




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
 
Ad

Advertisements

Ad

Advertisements

E

emailmygroup

I changed web.config as following

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


but no luck.
 

Top