Not a teaser this time but a real world problem that needs you.

I know nothing about character encodings. I know enough to have read Joel's piece and vowed that it's something I should definitely know about but not enough to have actually made tracks to aforementioned wisdom.

Today I am reminded of that vow by the gentle sting of my ignorance biting me on the bum.

For the last couple of days I've been coding keyboard shortcuts into my application. I want users to be able to change their keyboard shortcuts and to enter them into a preferences file. All good except I don't know how to map from the event.keyCode value to the Unicode value of the character in the preference file.

See my worries in a little AJAX(aka bait) demo here: keystrokes and keycodes (Non IE browsers only)

My problem is that I really don't see what the Javascript event.keyCode property actually maps to in terms of real characters.

Could someone who knows more than me about this please put me out of my misery and tell me how I can connect event.keyCode to String.charCodeAt() to Unicode?