Unicode and HtmlEncode

A

Anders Both

Hello dotnet.aspnet group -

I want to do encode e.g. japanise or arabic text into something like:

بةكوردي
عةلي

Before putting it in my HTML code (aspx page) . But when i try to use

System.Web.HttpUtility.HtmlEncode("Some arabic:????????? ???? ????????? ???
");

Only normal stuff like é etc are encoded, not all the arabic text.

I really hope someone can help me,

Ny the way are there any difference between
System.Web.HttpUtility.HtmlEncode and (this.)Server.HtmlEncode .

p.s. My unicode text is comming from the database, I am not writing it into
my files.

Best Regards,

Anders Both, Denmark.
 
P

Patrice Scribe

AFAIK what you write to the Response object is encoded as defined by your
web.config configuration file (utf-8 by default).

What if you try to just write your text ? For now I would say that it tries
to encode what you already encoded...

Patrice
 
A

Anders Both

I know that if I just write it, it is working fine, even in a .js file. But
I just felt it would be better with
بةكورد&#1610 style.

Even if I end up just writing it, I still mean that it should be possible to
htmlEncode arabic text.

Thx so fare.
 
A

Anders Both

If e.g. you want the text to be inside the <title></title> the unicodetext
have to be htmlEnoded.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top