I have js code:
'\u0421' in JavaScript is representative of a character. In Php however, it is not. That's why JavaScript is showing fewer spaces between index 0 and the first instance of 'a'.
To remedy this... I'm pretty sure this is what you're looking for... How to decode Unicode escape sequences like "\u00ed" to proper UTF-8 encoded characters?