Reimplemented multi-byte and wide-chars functions to not depend on