public CharsetMatch detect ( ) { // TODO: A better implementation would be to copy the detect loop from // detectAll(), and cut it short as soon as a match with a high confidence // is found. This is something to be done later, after things are otherwise // working. CharsetMatch matches [ ] = detectAll ( ) ; if ( matches == null || matches . length == 0 ) { return null ; } return matches [ 0 ] ; }
Return the charset that best matches the supplied input data .