def truncate_bytes!(max)
      return @wrapped_string if @wrapped_string.bytesize <= max
      curr = 0
      new = []
      unpack("U*").each do |char|
        break if curr > max
        char = [char].pack("U")
        curr += char.bytesize
        if curr <= max
          new << char
        end
      end
      @wrapped_string = new.join
    end
def truncate_bytes!(max)
      return @wrapped_string if @wrapped_string.bytesize <= max
      curr = 0
      new = []
      unpack("U*").each do |char|
        break if curr > max
        char = [char].pack("U")
        curr += char.bytesize
        if curr <= max
          new << char
        end
      end
      @wrapped_string = new.join
    end
Truncate the string to +max+ bytes. This can be useful for ensuring that
 a UTF-8 string will always fit into a database column with a certain max
 byte length. The resulting string may be less than +max+ if the string must
 be truncated at a multibyte character boundary.
 @example
   "üéøá".to_identifier.truncate_bytes(3) #=> "ü"
 @return String