Added support for non-default text encoding support