TextDecoder Web API | TextDecoder constructor Last Updated : 04 Oct, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report In HTML there is a TextDecoder Interface of which we can create a TextDecoder object for the encoding specified in parameter. Syntax: decoder = new TextDecoder( utf-Label, option ); Parameters: This constructor accepts two parameters which are mentioned above and described below: utf-Label: Label of the encoder in string format. It is "utf-8" as default. option: TextDecoderOptions dictionary which has a property fatal (It is a Boolean flag which indicates if the TextDecoder.decode() method should throw DOMException. It's default value is false.) Example 1: This example creating a TextDecoder object with "iso-8859-2" as parameter. html <!DOCTYPE html> <html> <head> <title> TextDecoder Web API | TextDecoder constructor </title> </head> <body> <center> <h1 style="color:green;"> GeeksforGeeks </h1> <h2>TextDecoder constructor</h2> <button onclick="gettextDecoder ();"> Get textDecoder object </button> <p id='textDecoder'></p> <script type="text/javascript"> function gettextDecoder() { var textDecoder1 = new TextDecoder("iso-8859-2"); console.log(textDecoder1); } </script> </center> </body> </html> Output: Before Click the button: After Click the button: Example: Create a comment object with nothing as parameter. So the default parameter which is "utf-8" will be taken. html <!DOCTYPE html> <html> <head> <title> TextDecoder Web API | TextDecoder constructor </title> </head> <body> <center> <h1 style="color:green;"> GeeksforGeeks </h1> <h2>TextDecoder constructor</h2> <button onclick="gettextDecoder ();"> Get textDecoder object </button> <p id='textDecoder'></p> <script type="text/javascript"> function gettextDecoder() { var textDecoder1 = new TextDecoder(); console.log(textDecoder1); } </script> </center> </body> </html> Output: Before Click the button: After Click the button: Supported Browsers: The browsers supported by TextDecoder constructor are listed below: Google Chrome 38 Firefox 19 Opera 25 Safari 10.1 Comment More infoAdvertise with us Next Article D3coder - Browser Extension to Encode or Decode D DeepakDev Follow Improve Article Tags : Web Tech Web-API Similar Reads Web API TextEncoder encodeInto() Method The encodeInto() method in TextEncoder API is used to take stream of points and emits the stream of UTF-8 bytes. All instances of TextEncoder only support UTF-8 encoding. The TextEncoder.encodeInto() takes a string to encode and an array to hold the encoded result and returns an object back. Syntax: 2 min read Web API | TextDecoder decode() Method The decode() method in TextDecoder API is used to takes a stream of bytes as input and emits a stream of code points. The TextEncoder decode() method takes an ArrayBuffer containing the encoded data and options object and returns the original string (i.e. decoded string). Syntax: decoder.decode(buff 2 min read Node.js TextEncoder The TextEncoder is an interface that takes a stream of code points as input and emits a stream of encoded UTF-8 codes. This is provided in NodeJS as an implementation of the WHATWG Encoding Standard 'TextEncoder' API. All instances of TextEncoder only support UTF-8 encoding. UTF-8: It is an encoding 2 min read D3coder - Browser Extension to Encode or Decode D3coder extension enables us to encode and decode selected text via the context menu. It reduces the time we spend looking up values and gives us more time to concentrate on the important things of development. One can even choose how to display the result, like whether to display the result using a 3 min read Java.net.URLEncoder class in Java This class is a utility class for HTML form encoding. Encoding makes the form of URL more reliable and secure. When the user request is triggered by a get method, the form parameters and their values are appended at the end of URL after a '?' sign. The problem arises when special characters are used 3 min read CharsetDecoder Class in Java For encoding and decoding tasks, many methods are offered in Charset Encoder and Charset Decoder classes in Java. The Charset Decoder class is used for text handling to convert bytes to characters. The Charset decoder accepts a sequence of bytes as its input and displays Unicode characters as output 5 min read Like