Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Server.HtmlDecode("‘") does not work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
emailmygroup@gmail.com - 17 Sep 2007 20:17 GMT
I am trying to decode character &#145#; but it is not working. Anybody
knows how to decode this character?
George Ter-Saakov - 17 Sep 2007 21:14 GMT
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.

>I am trying to decode character &#145#; but it is not working. Anybody
> knows how to decode this character?
bruce barker - 17 Sep 2007 21:22 GMT
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)

> I am trying to decode character &#145#; but it is not working. Anybody
> knows how to decode this character?
emailmygroup@gmail.com - 17 Sep 2007 21:51 GMT
>From URL
http://www.eggheadcafe.com/tutorials/aspnet/ca7f59b0-e086-4974-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 - 17 Sep 2007 21:57 GMT
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/
======================================
> >From URL
> http://www.eggheadcafe.com/tutorials/aspnet/ca7f59b0-e086-4974-9130-3210625e675c
/html-entities-class.aspx

[quoted text clipped - 8 lines]
> 146 represents single quote and 147 represents double quote. so my
> question is am I missing anything?
emailmygroup@gmail.com - 17 Sep 2007 22:03 GMT
Asc(Server.HtmlDecode("‘")) ' Output = 63 = "?"
emailmygroup@gmail.com - 18 Sep 2007 15:18 GMT
can anybody help me???
Juan T. Llibre - 18 Sep 2007 16:00 GMT
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/
======================================
> can anybody help me???
emailmygroup@gmail.com - 18 Sep 2007 16:43 GMT
On Sep 18, 10:00 am, "Juan T. Llibre" <nomailrepl...@nowhere.com>
wrote:
> I *reaally* don't understand your question.
>
[quoted text clipped - 8 lines]
> im txtenc2 as String = Server.HTMLDecode("&#145;")
> lblMessage6.Text = txtenc2

When I write Server.HTMLDecode("&#145;") 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 ?
>
[quoted text clipped - 7 lines]
>
> - Show quoted text -
Juan T. Llibre - 18 Sep 2007 19:49 GMT
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/
======================================
On Sep 18, 10:00 am, "Juan T. Llibre" <nomailrepl...@nowhere.com>
wrote:
> I *reaally* don't understand your question.
>
[quoted text clipped - 8 lines]
> im txtenc2 as String = Server.HTMLDecode("&#145;")
> lblMessage6.Text = txtenc2

When I write Server.HTMLDecode("&#145;") 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 ?
>
[quoted text clipped - 7 lines]
>
> - Show quoted text -
Göran Andersson - 18 Sep 2007 18:59 GMT
> I am trying to decode character &#145#; but it is not working. Anybody
> knows how to decode this character?

It's not working, because &#145; 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/

Signature

Göran Andersson
_____
http://www.guffa.com

Juan T. Llibre - 18 Sep 2007 19:52 GMT
re:
!> It's not working, because &#145; is not a valid html entity.

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

Why would Server.HTMLDecode("&#145;") 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/
======================================
>> I am trying to decode character &#145#; but it is not working. Anybody
>> knows how to decode this character?
[quoted text clipped - 18 lines]
> according to:
> http://www.webmonkey.com/reference/special_characters/
emailmygroup@gmail.com - 19 Sep 2007 17:06 GMT
I changed web.config as following

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

but no luck.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.