Get the byte array from a string using default encoding