[Petal] XIncludes and charsets

Chris Croome chris at webarchitects.co.uk
Fri Jan 24 14:07:30 GMT 2003


Hi

Say you have a load of Petal templates, all UTF-8 and then someone opens
one for editing in a not-so-clever editor which finds no non-ASCII
characters and decided that it's a ASCII file. The someone addes an
eacute and the not-so-clever editor decided to save the file back as
Latin-1.

This file that is now Latin-1 is XIncluded into another UTF-8 file...
things start to go horribly wrong...!

Perhaps Petal should check for a XML PI with the charset for each file
it XIncludes and use encode if needed, ie something like this:

  <?xml version="1.0" encoding="UTF-8" ?> [1]

In any case (Petal checking for charset conflicts or not) a PI like the
one above should probably be removed, if present, when a file is
XIncluded.


Chris

[1] http://www.w3.org/TR/REC-xml#sec-prolog-dtd

-- 
Chris Croome                               <chris at webarchitects.co.uk>
web design                             http://www.webarchitects.co.uk/ 
web content management                               http://mkdoc.com/   
everything else                               http://chris.croome.net/  



More information about the Petal mailing list