.NET Framework - 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
SQL Server
(1)
KeyID
(1)
Linebreaks
(1)
Höhrmann
(1)
Mannheim
(1)
Björn
(1)
Jeni
(1)
Sentences
(1)
  Bjoern Hoehrmann replied...
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/
  Neil Smith [MVP Digital Media] replied...
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
Create New Account
help
Simple Question - Does SQL Server 2005 Allows NULL for DateTime? .NET Framework Does SQL Server 2005 Allows NULL for DateTime? Just checking. C# Discussions SQL Server 2005 (1) SqlDateTime (1) DateTime (1) Nullable (1) Database (1) KeyID (1) Eq (1) MaxValue (1) SQL Server 2005 allows NULL for any data type to my knowledge, you flag this as
Upgraded to Visual C# Express 2005 SP1, can no longer persist data in SQL Server Express .NET Framework Hi, After upgrading C# Express 2005, none of my apps will persist data to SQL Server Express (have not yet applied the Service Pack. . .downloading now). While the application is running data is not being persisted in them either. I have tried inserting data with inline SQL, stored procedures, and the starter kits are using custom datasets, and the data keeps disappearing Anyone have any ideas? I tried googling for relevant information, no joy. C. C# Discussions SQL Server (1) TransactionScope (1) Visual (1) Database (1) KeyID (1) Pack (1) Vågsæther (1) Karlsen (1) Just off the top of my head, could
Parameterized Query .NET Framework Is there a way to see the exact SQL being generated from a parameterized query? I am using this technique but am getting some strange SQL errors during execution and I would like to see the final SQL that is being generated. C# Discussions SQL Server (1) LINQ (1) Database (1) KeyID (1) Vågsæther (1) Karlsen (1) Lasse (1) Bab0030aeccd (1) A parameterized query doesn't generate any other sql, the query is sent as-is to the database engine along with the parameter values them all together. In short, unless you're using a database that actually rewrites the sql with the parameter values verbatim, you won't get what you're asking for. - - Lasse
HttpHandler not getting called .NET Framework Hi All, Using vs 2005, c#, ms sql 2005 asp.net web site. Using httphandler to generate dynamic image from sql server database. Going according to instructions from msn: I'm using is Resuable and Process Request never get gets called. I call the photo using image.Src = "abc.xyz = " + "x.y?keyid = 9". I have everything set up in Web.Config in <httpHandlers> to register the httpHandler had set up in Web.Config? Steve Yes its correct. Its a page + "?" + imageHandler.PublicVar + " = " + KeyID something like. . page.aspx?keyid = 10 When I view the source html output it is exactly right. Joe, Could you helps, Steve keywords: HttpHandler, not, getting, called description: Hi All, Using vs 2005, c#, ms sql 2005 asp.net web site. Using httphandler to generate dynamic image from sql server database. Going according to inst