This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
error_log stderr; | |
pid nginx.pid; | |
daemon off; | |
events { | |
worker_connections 768; | |
} | |
http { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Sometimes, unicode symbols that have to be inserted in an HTML page should be escaped. | |
For example, everybody know, that’s “&” should be escaped as “&”, ” ” as “ ” and so on. | |
But what, if you should insert symbol, that you never used before. So you don’t know how it should be present or escaped. | |
Code below, helps you to get valid decimal unicode for appropriate symbol. | |
*/ | |
function getCharAsDecimalUTF8(char){ | |
var getUTF8 = escape(char); | |
console.log("&#" + parseInt(getUTF8.substring(getUTF8.match(/\%u/) !== null ? 2 : 1), 16) + ";"); | |
} |