improvement: String.encode()