SQL Server
(1)
KeyID
(1)
Linebreaks
(1)
Höhrmann
(1)
Mannheim
(1)
Björn
(1)
Jeni
(1)
Sentences
(1)

UTF-8

Asked By Jenny
21-Jun-07 12:33 PM
Hi!

Could somebody help me please.
I have a text that I download via XML from somebody's DB and I store it in
my SQL Server as ntext to preserve the UTF-8 formatting. It works well until
I output it on my ASP page. Linebreaks are missing altogether! I can see
them in the source for my HTML. I can also see them in the table in the DB
as little squares between the sentences but the final text on the ASP page
is all in 1 line (ASP page in of course is UTF-8 encoding and all other
chars are displayed perfectly).

Does anybody know if there is a function to display the breaks? Or maybe
somebody knows what stands behind those little squares in the DB table and I
could replace those characters in a simple ASP function before the HTML
output?

Thank you!

Jenny

* Jenny wrote in microsoft.public.

Asked By Bjoern Hoehrmann
21-Jun-07 01:42 PM
* Jenny wrote in microsoft.public.xml:

You have to use an HTML element that preserves the line breaks when
rendering the content. Try to enclose the text inside <pre>...</pre>.
Alternatively you could replace the line breaks with <br> elements or
split the text at line breaks and wrap each inside a <p> element, or
something similar.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/

UTF-8

Asked By Neil Smith [MVP Digital Media]
21-Jun-07 02:01 PM
On Thu, 21 Jun 2007 18:33:25 +0200, "Jenny" <barroli@wanadoo.fr>




Line breaks are not respected in a browser, which will condense all
consecutive space. HTML and XHTML use the <br /> element instead.

There's a way to show line breaks without running an XSL transform to
convert newlines to <br /> by placing the entire output inside
will show the content with the line breaks, tabs and consecutive
spaces intact (though it will then probably look horrible)

Doug Dawson's site has an XSLT transformation to convert newlines to
see answer #2 from Jeni Tennison.


HTH
Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs
Post Question To EggHeadCafe