In HTML there is a TextEncoder Interface which has a property encoding which tells us about the encoding algorithm used by the encoder. It can only have the value that is utf-8.
var b = encoder.encoding;
Return Value: It returns the name of the encoding algorithm.
- Before clicking the button:
- After clicking the button:
Supported Browsers: The browser supported by TextEncoder encoding property are listed below:
- Google Chrome 38
- Firefox 19
- Opera 25
- Safari 10.1
- Web TextEncoder API | TextEncoder encode() method
- HTML | URL Encoding
- HTTP headers | Accept-Encoding
- How to convert an image to base64 encoding in PHP?
- HTTP headers | Transfer-Encoding
- HTTP headers | Content-Encoding
- CSS | transition-property Property
- CSS | nav-up property
- CSS | nav-right property
- CSS | top Property
- CSS | all Property
- CSS | right Property
- CSS | nav-down property
- CSS | left Property
- Web API | DOMRect right property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.