473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Unicode to HTML converter/cleaner

Rob
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.
Nov 14 '07 #1
6 1871

I suppose you need to smth like System.Text.Encoding.Convert and
HttpServerUtility.HtmlEncode methods

Btw, all strings in .NET are unicode ones

--
WBR, Michael Nemtsev [.NET/C# MVP].
Blog: http://spaces.live.com/laflour

"Rob" wrote:
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.
Nov 15 '07 #2

I suppose you need to smth like System.Text.Encoding.Convert and
HttpServerUtility.HtmlEncode methods

Btw, all strings in .NET are unicode ones

--
WBR, Michael Nemtsev [.NET/C# MVP].
Blog: http://spaces.live.com/laflour

"Rob" wrote:
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.
Nov 15 '07 #3
Rob
I suppose you need to smth like System.Text.Encoding.Convert and
HttpServerUtility.HtmlEncode methods
Thanks - I'll have a look at those.

Cheers, Rob.
Nov 19 '07 #4
"Göran Andersson" <gu***@guffa.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
If you are using HTML, it's <br>. If you are using XHTML, it's <br/>.
At the risk of extreme pedantry, it's <br />, not <br/>

:-)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 20 '07 #5
Rob
At the risk of extreme pedantry, it's <br />, not <br/>

Yes I'd read that somewhere but then seen many places where the space was
been dropped.

Such as internet standards :-)

Cheers, Rob.
Nov 21 '07 #6
"Rob" <rob_nicholson@nospam_unforgettable.comwrote in message
news:0w****************@newsfe4-gui.ntli.net...
>At the risk of extreme pedantry, it's <br />, not <br/>

Yes I'd read that somewhere but then seen many places where the space was
been dropped.
Of course you have - the Internet is littered with badly-formed markup...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 21 '07 #7

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

Similar topics

3
by: Michael Weir | last post by:
I'm sure this is a very simple thing to do, once you know how to do it, but I am having no fun at all trying to write utf-8 strings to a unicode file. Does anyone have a couple of lines of code...
12
by: Peter Wilkinson | last post by:
Hello tlistmembers, I am using the encoding function to convert unicode to ascii. At one point this code was working just fine, however, now it has broken. I am reading a text file that has is...
27
by: EU citizen | last post by:
Do web pages have to be created in unicode in order to use UTF-8 encoding? If so, can anyone name a free application which I can use under Windows 98 to create web pages?
20
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than...
48
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at...
40
by: apprentice | last post by:
Hello, I'm writing an class library that I imagine people from different countries might be interested in using, so I'm considering what needs to be provided to support foreign languages,...
4
by: Justin | last post by:
Hi, i need some help on this urgently... Thanx.... The situation is like this, i need to find out the way to convert Chinese characters into hexa code. but the problem is what i got from bin2hex()...
9
by: mistral | last post by:
Is there some Unicode converter to convert javascript to Unicode format? thanks mistral
2
by: schneider | last post by:
as a biginner, maybe I have a question already answered 1000 times but I do not know how to find the answers. problem: depending on an input value, I would like to output greek characters...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.