1. The charset is set in the nav as a backup encoding declaration since nav's are machine parsed to create the toc much like the old ncx was (ie act in a stand alone manner) and that parsing software is not always robust depending on the e-reader. Placement before or after the title is not relevant. Typically it is grepped for in the first 1024 characters by software that tries to guess character encoding.
2. language can be determined for all xhtml pages from the opf first dc:language metadata tag and if the xhtml only uses a single language this is all that should be needed. Accessibility has now made adding it more important as screen reading software typically does not grok the opf. So adding xml:lang and lang attributes to tags when specifying a language being used is always a good idea for accessibility reasons. Again this is added for the nav as it is independently machine parsed to extract landmarks and toc info by specific e-reader device software and should stand up on its own as a backup..
If you want to automate adding lang attributes as part of Sigil for all xhtml pages, you can easily do that in Sigil using plugins (Access-Aide), or just specify your own default xhtml file template (see our latest user guide for details) or just use global find and replace once at the end.
3. not unless that xhtml is meant to stand alone outside of the opf or epub. The xml header specifies the encoding. But support for anything other than utf-8, utf-16 ((le or be) and utf-32 has been long deprecated and the final 2 should use byteorder marks that determine / identify them. All other 8 bit encodes should be transcoded to utf-8 properly before adding them to your xhtml file.
Here is what the w3c says about xml/xhtml and the use of charset:
Quote:
The charset attribute specifies the character encoding used by the document. This is a character encoding declaration. If the attribute is present in an XML document, its value must be an ASCII case-insensitive match for the string "UTF-8" (and the document is therefore forced to use UTF-8 as its encoding).
The charset attribute on the meta element has no effect in XML documents, and is only allowed in order to facilitate migration to and from XHTML.
|
4. By default now all css is considered to be utf-8 encoded. Here is what the latest mdn spec states about use of charset in css:
Quote:
The @charset CSS rule specifies the character encoding used in the style sheet. Although the first character in @charset is the @ symbol, it is not an at-rule. The CSS syntax module deprecates this rule, defining it as an unrecognized legacy rule to be dropped when a stylesheet is grammar-checked, but it is fully supported in all browsers.
|
So adding that can not hurt but it is not needed anymore and it is one of the first things removed by most css minimizer or linting software software when speed of access is determined to be important for web pages.