ADD dirname function support from different fileSystem encoding.

Signed-off-by: Richard Lea <chigix@zoho.com>