Added a way to change the string encoding in the byte array functions.