webbukkit/dynmap — Issue #470: Dynmap doesn't support russian symbols.
Author: BabyKiller
Created: 2011-10-17 07:22:31+00:00
State: open

![DynMap Chat](http://piccy.info/view3/2109502/ebcc239af7fe26568f31cbe894e1b016/)

I tried to change:
In HTML:
*html lang="en" to html lang="ru";
*meta charset="utf-8" to meta charset="windows-1251";
but no changes.

Here's one way of solving that helps you solve the problem:

In file "minecraft.js" add this function:

function chat_encoder(message) {
//patch
if (message.source === 'player') {
var utftext = "";
for (var n = 0; n < message.text.length; n++) {
var c = message.text.charCodeAt(n);
if (c >= 192) {
var c = message.text.charCodeAt(n);
utftext += String.fromCharCode(c+848);
}
else if (c == 184) { utftext += String.fromCharCode(1105); }
else {
utftext += String.fromCharCode(c);
}
}
return utftext
}
//patch
return message.text;
}

In file "chatbox.js" replace "message.text" to "chat_encoder(message)"
In file "chatballoon.js" replace "message.text" to "chat_encoder(message)"