Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Illegal characters

Hi guys,
I need to be able to save and retrieve the following characters using VB6/SQLServer2000/HTML/XML/XSLT.

, . () ? ! @ # $ % & and foreign language e.g.

Just wondering is there any way of doing it as my system is crashing on them.

Thanks in advance.

Michael
[309 byte] By [Michael] at [2007-11-9 15:25:55]
# 1 Re: Illegal characters
I've hit the same barrier with XML/XSLT. To work round it I store the data
with the characters in SQL Server but do a Replace to #encoding on any data
select statement.
Mark.

"Michael" <m124@hotmail.com> wrote:
>
>Hi guys,
>I need to be able to save and retrieve the following characters using VB6/SQLServer2000/HTML/XML/XSLT.
>
>, . () ? ! @ # $ % & and foreign language e.g.
>
>Just wondering is there any way of doing it as my system is crashing on
them.
>
>Thanks in advance.
>
>Michael
>
Mark at 2007-11-11 23:30:03 >
# 2 Re: Illegal characters
"Michael" <m124@hotmail.com> wrote:
>
>Hi guys,
>I need to be able to save and retrieve the following characters using VB6/SQLServer2000/HTML/XML/XSLT.
>
>, . () ? ! @ # $ % & and foreign language e.g.
>
>Just wondering is there any way of doing it as my system is crashing on
them.
>
>Thanks in advance.
>
>Michael
>

You should store the data in SQL2K nvarchar data type columns in order to
preserve any double-byte characters you might have in foreign character sets.
When you use XML and XSLT you need to use the <![CDATA[ tag around your
data to preserve any special characters.

See below:

<?xml version="1.0"?>
<customer id=123456789>
<email_addr><![CDATA["John Doe" <jdoe@nowhere.com>]]></email_addr>
<name_full><![CDATA[Mr. John Doe]]></name_full>
</customer>

Using the nvarchar data type and the CDATA tags should be about all you need
to incorporate in your solution to preserve any special characters.

CK
CK
Chris Kurpgeweit at 2007-11-11 23:30:58 >