On 07/22/2010 12:32 PM, Mariusz Idzikowski wrote: > > By accident I discovered two problems in the XHTML configuration: > > 1) (minor problem) The template files (page_loose.html and > page_strict.html) do not contain any charset information (e.g. > "content-type=text/html; charset=UTF-8"). New documents based on these > templates are saved in the UTF-8 encoding (without BOM). However, the > lack of both the meta tag and the BOM may mislead some browsers into > believing that the actual encoding is the default system encoding. > > 2) (major problem) Even for files with charset defined as UTF-8, the > XHTML Preview command seems to ignore the meta tag and saves the > __PREVIEW__ file in what appears to be the default system encoding > (winansi on Windows). For example, the following short file containing a > couple of Polish diacritic characters: > > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta content="text/html; charset=UTF-8" http-equiv="content-type" /> > <title>ąćęłńóśźż</title> > </head> > <body> > <p>ąćęłńóśźż</p> > </body> > </html> > > is saved in the cp1250 (Central European) encoding regardless of the > charset given (here UTF-8). Consequently there is a clash between the > content-type provided in the meta element and the actual encoding and > the document is displayed wrong. > > I have enclosed the file in case you want to check for yourself. My > machine is Windows Vista. > > Here are some suggestions: > > 1) consider adding the meta element to page_loose.html and > page_strict.html (defaulting, for example, to UTF-8) (unless there a > reason not to)
To our knowledge, XHTML, which is also well-formed XML, does *not* need the <meta content="text/html; charset=UTF-8" http-equiv="content-type" /> That's why the stock document templates do not contain such meta. Note that it is easy to create and register with XXE your own document templates. See "Save Document As Template" in http://www.xmlmind.com/xmleditor/_distrib/doc/help/optionsMenu.html#customizeConfigurationMenu > 2) change the Preview command so that it correctly detects the charset > information in the file or uses UTF-8 by default > In principle, this is already the case. We'll re-check our charset detection code and if there is a bug, we'll fix it for next release. Thank you for taking the time to report this problem! -- XMLmind XML Editor Support List [email protected] http://www.xmlmind.com/mailman/listinfo/xmleditor-support

