Characters replacement with array key/value
<p>I try to replace some specials characters (emojis) based on a replacement map.<br>
I wrote this piece of code but it still not work..</p>

<pre><code>var char_map = {
    '■': 'e',
    '­♥': 'a',
    '♦': 'm',
};

$.fn.map_replace = function() {
    $(this).html(function(i, content) {
        $.each(char_map, function(key, value) {
            content = content.replace(key, value);
        });
        return content;
    });
};

$(".comment").map_replace();
</code></pre>

<p><a href="http://jsfiddle.net/NaX6v/" rel="nofollow" title="jsFiddle">This code on jsFiddle</a></p>

<p>Thanks for helping :)</p>
