A function from k.ken’s response:
function unicodeToChar(text) {
return text.replace(/\\u[\dA-F]{4}/gi,
function (match) {
return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16));
});
}
Takes all unicode characters in the inputted string, and converts them to the character.
Related Contents:
- How can I use Unicode-aware regular expressions in JavaScript?
- Concrete JavaScript regular expression for accented characters (diacritics)
- How to prevent Unicode characters from rendering as emoji in HTML from JavaScript?
- Javascript RegExp + Word boundaries + unicode characters
- String length in bytes in JavaScript
- utf-8 word boundary regex in javascript
- Javascript: Unicode string to hex
- Decode UTF-8 with Javascript
- Remove zero-width space characters from a JavaScript string
- JavaScript strings outside of the BMP
- How to remove emoji code using javascript?
- \u200b (Zero width space) characters in my JS code. Where did they come from?
- How can I split a string containing emoji into an array?
- How to find the unicode of the subscript alphabet?
- Insert Unicode character into JavaScript
- Programatic Accent Reduction in JavaScript (aka text normalization or unaccenting)
- Match any non-word character (excluding diacritics)
- JavaScript regular expression for Unicode emoji
- Matching accented characters with Javascript regexes
- Converting punycode with dash character to Unicode
- Why can’t I use accented characters next to a word boundary?
- Javascript unicode string, chinese character but no punctuation
- Javascript string comparison fails when comparing unicode characters
- Split JavaScript string into array of codepoints? (taking into account “surrogate pairs” but not “grapheme clusters”)
- Printing emojis with JavaScript and HTML
- How do I fix this missing semicolon syntax error in Javascript?
- Convert Data URI to File then append to FormData
- Changing the image source using jQuery
- How can I make console.log show the current state of an object?
- Django Template Variables and Javascript
- How to embed fonts in HTML?
- How to run function in AngularJS controller on document ready?
- How to parse an RSS feed using JavaScript?
- How to swap two variables in JavaScript
- How to invert (transpose) the rows and columns of an HTML table?
- Cross-origin data in HTML5 canvas
- How to trigger click on page load?
- $.each() vs for() loop – and performance
- Transforming a Javascript iterable into an array
- Javascript group objects by property [closed]
- download csv file from web api in angular js
- Embedding SVG in PDF (exporting SVG to PDF using JS)
- Is there a way to zoom into a D3 force layout graph?
- Why doesn’t Node.js have a native DOM?
- Hide div element when screen size is smaller than a specific size
- Limit labels number on Chart.js line chart
- In JavaScript, is chained assignment okay?
- Inspect the names/values of arguments in the definition/execution of a JavaScript function
- The data-toggle attributes in Twitter Bootstrap
- ES6 module syntax: is it possible to `export * as Name from …`?