scala.xml.include.sax

object EncodingHeuristics

[source: scala/xml/include/sax/EncodingHeuristics.scala]

object EncodingHeuristics
extends AnyRef

EncodingHeuristics reads from a stream (which should be buffered) and attempts to guess what the encoding of the text in the stream is. If it fails to determine the type of the encoding, it returns the default UTF-8.

Author
Burak Emir
Paul Phillips
Method Summary
def readEncodingFromStream (in : java.io.InputStream) : java.lang.String
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Object Summary
object EncodingNames extends AnyRef
Method Details
def readEncodingFromStream(in : java.io.InputStream) : java.lang.String

This utility method attempts to determine the XML character encoding by examining the input stream, as specified here: http://www.w3.org/TR/xml/#sec-guessing

Parameters
in - InputStream to read from.
Returns
String The name of the encoding.
Throws
IOException - if the stream cannot be reset