Respect httpCharset in treemenu
Since #b768d2, treemenu is broken because htmlentities() needs to know
the charset used, especially when it is not UTF-8 (PHP 5.4) or
ISO-8859-1 (PHP 5.3).
Also use mb_strlen() instead of strlen(), and specify the charset in the
Content-Type HTTP header.

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>