I'm trying to create an chrome extension for a chat on a webpage. I've created a method to post messages into the chat:
function postMsg(msg) {
var data = {chat_message:msg.trim(), "chat_submit": "Send"}
console.log(msg);
$.post("http://example.com/", data);
}
It does not support æåø characters that uft-8 supports. It appear like this: MÃ¥ gÃ¥
and it should look like Må gå
.
I've tried to output the var into the console. And it output it how it should be outputted. The chat also support UFT-8.
How should I solve this task?
EDIT: my problem was exacly like descibed here: How do I transcode a Javascript string to ISO-8859-1?
It also solved my problem.