JSON.stringify () - UTF-8
1 answer
So yes, JSON.stringify()
will return a string in whatever encoding your implementation uses for strings. If you found a way to change this encoding in the context of your script, it will no longer be a valid JavaScript string.
For serializing it over the network, however, I expect it to be auto-encoded into the HTTP request character set (assuming you're talking about HTTP). Therefore, if you send it via HTTP POST with the UTF-8 character set, your browser should transparently handle the transcoding of that data before sending it.
Otherwise browsers will really struggle with character set handling.
+1
source to share