I want to create a JS script that can identify non-ASCII characters in a string and replace them with their corresponding Unicode code points (i.e. Lorem ipsum á dolor sit amet
becomes Lorem ipsum [00E1] sit amet
). I've already created a basic program for doing so, but I've noticed that it interprets characters with more than 5 digits in their code point (e.g.