Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XML and special characters ... [Thread Next] Re: XML and special characters ...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/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
