Home > Archive > MS SQL XML > May 2005 > Special (international) characters in updategrams generated with asp









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Special (international) characters in updategrams generated with asp
Bernd

2005-05-30, 8:24 pm

Well, I have searched the whole web for this problem without success.
Finally I have found some similar questions here but also no answers.
After several days of trouble-shooting I have finally
solved it. Maybe there are others still having the same trouble so I
decided to post the solution without the question ;-)

The situation:

After posting a form to an ASP-Page all the international characters
(like german umlaute) where "destroyed". Surprisingly capital
characters worked fine.

The encoding was fine everywhere:
OLEDB:
adoStreamQuery.Charset = "ISO-8859-1"
...
adoCmd.Properties("Output Encoding") = "ISO-8859-1"

XML:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="./xsl/110_110.xsl" ?>
....

XSLT:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" />
....

Finally I have found the "Internet Explorer Tools for Validating XML
and Viewing XSLT Output" at
http://www.microsoft.com/downloads/...&DisplayLang=en
whicht showed me that it wasn't MSXML or SQLXML causing the problem!

The correct XSLT must look like this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes"
encoding="ISO-8859-1"/>
....

Otherwise the IE assumes the encoding to be UTF-16 and adds a META
entry into the XSLT output on it's own! Somehow all the ISO-characters
in the XSLT output where displayed correctly but the POST
was then encoded in UTF-16...

I hope this will help all of you dealing with languages like german,
french, danish, swedish and so on.

Bernd

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com