Dealing with UTF surrogate pairs in JavaScript
blog.vihan.org