private static InputSource stringToSource ( String str ) { InputSource is = new InputSource ( new StringReader ( str ) ) ; is . setEncoding ( "UTF-8" ) ; return is ; }
Convert a string to an InputSource object