add a method

To retrieve the character code in a cross-browser way