I have provided an implementation of UTF8 encoding and decoding functions in Javascript language.
At first view, it seems to be useless, because the browser automatically encodes/decodes the sent/recieved data based on the charset of the page that is specified in the response headers.
but it may be useful for certain purposes. for example when you want to transfer page contents in an encrypted format,
you must encrypt the content of the page at server side and then decrypt it at client side.
At this situation, after decrypting data at client side, if the page contains UTF8 encoded data, it must be decoded from UTF8 to Unicode before use.
Download UTF8 Source Code in JavaScript
Example :
| Unicode String: | UTF8 Encoded String: | |
|
|