473,796 Members | 2,537 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unicode and HtmlEncode

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.Http Utility.HtmlEnc ode("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.Http Utility.HtmlEnc ode and (this.)Server.H tmlEncode .

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

Best Regards,

Anders Both, Denmark.
Nov 18 '05 #1
4 2748
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

--

"Anders Both" <an********@hot mail.com> a écrit dans le message de
news:eq******** ******@TK2MSFTN GP11.phx.gbl...
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.Http Utility.HtmlEnc ode("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.Http Utility.HtmlEnc ode and (this.)Server.H tmlEncode .

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

Best Regards,

Anders Both, Denmark.


Nov 18 '05 #2
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.

"Patrice Scribe" <no****@nowhere .com> wrote in message
news:#I******** ******@TK2MSFTN GP10.phx.gbl...
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

--

"Anders Both" <an********@hot mail.com> a écrit dans le message de
news:eq******** ******@TK2MSFTN GP11.phx.gbl...
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.Http Utility.HtmlEnc ode("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.Http Utility.HtmlEnc ode and (this.)Server.H tmlEncode .

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

into
my files.

Best Regards,

Anders Both, Denmark.

Nov 18 '05 #3
If e.g. you want the text to be inside the <title></title> the unicodetext
have to be htmlEnoded.
"Patrice Scribe" <no****@nowhere .com> wrote in message
news:#I******** ******@TK2MSFTN GP10.phx.gbl...
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

--

"Anders Both" <an********@hot mail.com> a écrit dans le message de
news:eq******** ******@TK2MSFTN GP11.phx.gbl...
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.Http Utility.HtmlEnc ode("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.Http Utility.HtmlEnc ode and (this.)Server.H tmlEncode .

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

into
my files.

Best Regards,

Anders Both, Denmark.

Nov 18 '05 #4

Look here, to see that title is not working:

http://home.hi-ho.ne.jp/home/bb/adsl...cc_course.html

"Patrice Scribe" <no****@nowhere .com> wrote in message
news:#I******** ******@TK2MSFTN GP10.phx.gbl...
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

--

"Anders Both" <an********@hot mail.com> a écrit dans le message de
news:eq******** ******@TK2MSFTN GP11.phx.gbl...
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.Http Utility.HtmlEnc ode("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.Http Utility.HtmlEnc ode and (this.)Server.H tmlEncode .

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

into
my files.

Best Regards,

Anders Both, Denmark.

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1994
by: Hans | last post by:
I found this articel that says that Server.HtmlEncode will screw up unicode data. I'm using htmlencode on many pages and cannot see that data are corrupted. It says in the "This information in this article applies to" section that it is applicable for ASP 2.0 with IIS4 and IIS5. I thought IIS5 only supported ASP 3.0? Is the Server.HtmlEncode OK to use in ASP3.0 on IIS5? http://support.microsoft.com/?kbid=259352 Regards
4
4088
by: abcd | last post by:
Simple but not working at this moment I have to fill the HTML select control.... my values could be for example "test number 1" sample code, dim x Data = "test number 1"
3
4111
by: Michael Gaillez | last post by:
Hi, I'm dynamically loading an assembly into an ASP.NET application. In the control that I load from that dynamic assembly I've tried to use Server.HTMLEncode but this results in a serious performance loss. Is there anyone who knows why or is there an alternative for server.htmlencode method? Without the server.htmlencode the thingy works very fine. greetz
6
2015
by: Jonas | last post by:
Hi! I'm developing an ASP.NET application that fetches Unicode string data from a SQL Server. I'm using "Lucinda Sans Unicode" as the font for my web pages but when I have a string containing the subscripted character "2" (as in CO2), I get the box character instead. This is a problem only in Internet Explorer, because if I try my web page in Firefox, it shows the character in a correct fashion. I've tried to use the Server.HTMLEncode...
4
4683
by: Andy Fish | last post by:
When using databinding, I have gotten into the habit of using single quotes (apostrophe) round attribute values rather than double quotes because this allows visual studio to work when there are quotation marks in the databinding expression. As far as I can tell this seems to be recommended practice. However, I just realised that HtmlEncode doesn't encode apostrophes, so if you do something like this <a href=......
0
453
by: Atara | last post by:
I have a file path that contains unicode characters. e.g: "C:\vs2003\OutputDir???\mc_data\" I want to translate this string to HTML with unicode characters: e.g: "C:\vs2003\OutputDirאבג\data\" I tried strPath = System.Web.HttpUtility.HtmlEncode(strPath) but it did not work. I suppose I can create bytes from strPath and if I get (ascii > 127)
1
2182
by: Abe Simpson | last post by:
Hi all, My form file has this attribute: <META http-equiv="Content-Type" content="text/html; charset=utf-8"> The form's action points to an .aspx file where I try to retrieve field values as follows: txtTextBox.Text = Request;
3
2892
by: David Lozzi | last post by:
Howdy, I have my left navigation of Hyperlinks, and part of the link's querystring is the title of the page they are going to. For example, one of the pages is Cars & Trucks. With HtmlEncode, it translates it to Cars%20&%20Trucks. The ampersand is still there. Shouldn't the HtmlEncode translate that? So on the page the title is Cars because its translating the & as a new name/value pair. Any suggestions? Thanks!
6
1890
by: Rob | last post by:
Is there a handy .NET call to convert a Unicode string to valid HTML so sticking in an <pinner HTML? Kind of thing converts "<" to &lt and multiple spaces to &nbsp etc. I need to display unicode text from a database on the web page. Cheers, Rob.
0
9683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.