nl_tokens: Get correct codec for given encoding .
pl_tokens: function ( encoding ) { var enc = encoding || "utf8" ; var codecOptions = undefined ; while ( 1 ) { if ( getType ( enc ) === "String" ) enc = enc . replace ( / [- ] / g , "" ) . toLowerCase ( ) ; var codec = iconv . encodings [ enc ] ; var type = getType ( codec ) ; if ( type === "String" ) { // Link to other encoding. codecOptions = { originalEncoding : enc } ; enc = codec ; } else if ( <mask> === "Object" && codec . type != undefined ) { // Options for other encoding. codecOptions = codec ; enc = codec . type ; } else if ( type === "Function" ) // Codec itself. return codec ( codecOptions ) ; else throw new Error ( "Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')" ) ; } }