JSON.stringify() to UTF-8
问题 Javascript uses as far as I know UTF-16 fundamentally as a standard for strings. With JSON.stringify() I can create a JSON string from an object. Is that JSON string UTF-16 encoded? Can I convert (hopefully fast) that string to UTF-8 to save bandwidth for huge files (1MB JSON)? 回答1: JavaScript engines are allowed to use either UCS-2 or UTF-16. So, yes, JSON.stringify() will return a string in whatever encoding your implementation uses for strings. If you were to find a way to change that