Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML and special characters ...

From: Peter Flynn <peter.nosp@-.--------.-->
To: NULL
Date: 11/30/2005 11:28:00 PM
Alan Searle wrote:

> For reporting purposes I generate XML from an MS-Access 2002 database
> and find that in this way I can format and display the data no problem
> with a XSL/HTML template.  Perfect!
> 
> However, then I found that I needed to replace my automatic MS-Access
> output with a customised dump of the XML and find that I am now having
> a problem with special characters (umlauts).
> 
> For my tests I have built two identical extracts one generated by
> MS-Access and the other constructed by me using VBA.  Here I find that
> my (VBA generated) version produces an error message 'illegal
> characters' (stopping at the point where umlauts: ä and ü are found)
> in the browser while the MS-Access generated version still displays.
> 
> It can't be anthing in the content because both files are identical so
> I am wondering whether I need to make any specific declarations when I
> open the text file in VBA?  Are there any hidden commands which
> indicate which characterset the file will contain?
> 
> Any tips or links on the issue of handling special characters in XML
> would be a great help.

The default character encoding in XML is UTF-8, so unless one or other 
of your sample files specifies something else, your XML processor will
assume UTF-8, and therefore the file that fails must be using some other
encoding. For most western European languages, ISO-8859-1 is sufficient,
so try prefixing the VBA file with an XML Declaration saying so:

<?xml version="1.0" encoding="iso-8859-1"?>

///Peter
-- 
XML FAQ: http://xml.silmaril.ie/



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent