[lfs-dev] How change charset of html to utf-8

Ken Moffat zarniwhoop at ntlworld.com
Sun May 18 03:14:38 PDT 2014


On Sun, May 18, 2014 at 01:28:38PM +0800, Lei Tong wrote:
> Thanks for all your answers. I find that this file tidy.conf decide which
> charset to be used on html.
> After I changed almost file from encoding="ISO-8859-1" to encoding="UTF-8",
> that is , I did this command:
> 
> sed -i "s/version=\"1.0\"\ encoding=\"ISO-8859-1\"/version=\"1.0\"\
> encoding=\"UTF-8\"/g" `grep version=\"1.0\"\ encoding=\"ISO-8859-1\"
> -rl BOOKPATH/`
> 
> then those Chinese characters can be show on html pages. But it's not
> perfect. Because the charset of html is still iso-8859-1, and Chinese
> characters on html page's souece were displayed like these:
> 为构建
> 
> Then I modyfied tidy.conf, changed input-encoding and output-encoding
> from latin1 to utf8, as a result, Chinese characters can be showed
> normally on both html pages and html page's source.
> 
> And then I modified stylesheets/lfs-xsl/chunk-slave.xsl, change from
> select="'ISO-8859-1'" to select="'UTF-8'" for some special symbols to
> be show. Till now, everything on html for Chinese characters seems
> perfect :)
> 

 Thanks for those extra details - I don't have tidy installed (it
was a waste of time for my local rendering, and the books get
rendered on the LFS server), and I didn't bother creating HTML
tarballs.

ĸen
-- 
das eine Mal als Tragödie, dieses Mal als Farce


More information about the lfs-dev mailing list