I am using charCodeAt to convert 3 characters to hex.

var chop= str.slice(2,5);
var hex = '';
for(var i=0;i<chop.length;i++) {
hex += ''+chop.charCodeAt(i).toString(16);}

Using this code works fine below code 127 ($7F) but above that, it gives FFFD for all chars to 255($FF).
Is it something I am doing wrong or is charCodeAt limited to below the $7F character codes?
I specified UTF-8 in the script line, and used Eclipse to edit the file. Chrome and Mozilla both wont display the correct character ( for those above $7F) although I have set the font to UTF-8 in the browsers.
If you think I might have encoded the file incorrectly in Eclipse, please point me toward how I can change that.
Thanks for any help.