adding encode codepoint (incomplete)