I just found the alias htf files, which makes the business of reusing the utf8song*.htf files (contributed by CTeX forumers, now shipped with tex4ht) easier.
After an initial (unsuccessful) run of tex4ht, you'd notice the errors messages like
--- warning --- Couldn't find font 'unihei7a.htf' (char codes: 0--255)
So you know you will need to map unihei*.htf files to use utf8song*.htf instead.
For each utf8song*.htf file in %TEX4HT%/ht-fonts/unicode/cjk/utf8/, create a file unihei*.htf that contains the single line
.utf8song* .
The following Bash script will generate new alias unihei*.htf files from utf8song*.htf:
for file in *.htf; do alias_name=${file/utf8song/unihei}; sudo echo .${file%.htf} > $alias_name; done;
You can leave the new files in %TEX4HT%/ht-fonts/unicode/cjk/utf8/, or move them to %TEX4HT%/ht-fonts/alias/cjk/utf8/ for tidier housekeeping.
(Again, remember to check that tex4ht.dir in %TEX4HT%/tex4ht/base/unix/tex4ht.env is replaced with the correct actual path.)
Then run
htlatex test.tex "xhtml,charset=utf-8,NoFonts,fonts" " -cunihtf -utf8"
(The NoFonts directive eliminates the verbose <span>s around each CJK character. The fonts directive would put a <span> for things like \textbf, \emph with the appropriate classes, so that you can style them with CSS as you may wish.)
.htffiles for GBK encoding installed in TeX Live. So you can change the document encoding to use GBK font mappings. – Leo Liu Mar 18 '12 at 7:10