implement charCodeAt