Added String encoding support
diff --git a/src/main/java/org/apache/sling/resource/filter/ResourceFilter.java b/src/main/java/org/apache/sling/resource/filter/ResourceFilter.java
index 52f9a7d..a4b8045 100644
--- a/src/main/java/org/apache/sling/resource/filter/ResourceFilter.java
+++ b/src/main/java/org/apache/sling/resource/filter/ResourceFilter.java
@@ -40,7 +40,8 @@
      * Creates a {@link Predicate<Resource>} using the input String as the basis of

      * the selection

      * 

-     * @param matchDefinition Script used to define the matching requirements for the Predicate

+     * @param matchDefinition

+     *            Script used to define the matching requirements for the Predicate

      * @throws ParseException

      */

     public ResourceFilter(String matchDefinition) throws ParseException {

@@ -48,6 +49,21 @@
         this.parsedPredicate = rootNode.accept(getContext().getLogicVisitor());

     }

 

+    /**

+     * Creates a {@link Predicate<Resource>} using the input String as the basis of

+     * the selection

+     * 

+     * @param matchDefinition

+     *            Script used to define the matching requirements for the Predicate

+     * @param charEncoding

+     *            char encoding of the matchDefinition

+     * @throws ParseException

+     */

+    public ResourceFilter(String matchDefinition, String charEncoding) throws ParseException {

+        Node rootNode = new FilterParser(new ByteArrayInputStream(matchDefinition.getBytes()), charEncoding).parse();

+        this.parsedPredicate = rootNode.accept(getContext().getLogicVisitor());

+    }

+

     @Override

     public boolean test(Resource resource) {

         return parsedPredicate.test(resource);

diff --git a/src/main/java/org/apache/sling/resource/filter/ResourceFilterStream.java b/src/main/java/org/apache/sling/resource/filter/ResourceFilterStream.java
index eafa4f1..0c06c7c 100644
--- a/src/main/java/org/apache/sling/resource/filter/ResourceFilterStream.java
+++ b/src/main/java/org/apache/sling/resource/filter/ResourceFilterStream.java
@@ -39,18 +39,50 @@
     public Stream<Resource> stream(String branchSelector) throws ParseException {

         return stream(new ResourceFilter(branchSelector));

     }

-    

+

+    /**

+     * Creates a Stream<Resource> using the branchSelector to create the traversal

+     * predicate to select the appropriate child resources

+     * 

+     * @param branchSelector

+     *            resourceFilter script for traversal control

+     * @param charEncoding

+     *            char encoding of the branch selector String

+     * @return ResourceStream

+     * @throws ParseException

+     */

+    public Stream<Resource> stream(String branchSelector, String charEncoding) throws ParseException {

+        return stream(new ResourceFilter(branchSelector, charEncoding));

+    }

+

     /**

      * Provides a stream of the child resources of the base resource. The predicate

      * is a filter to determine which of the children are returned

      * 

      * @param childSelector

      * @return

-     * @throws ParseException 

+     * @throws ParseException

      */

     public Stream<Resource> listChildren(String childSelector) throws ParseException {

         return StreamSupport.stream(Spliterators.spliteratorUnknownSize(resource.listChildren(),

                 Spliterator.ORDERED | Spliterator.IMMUTABLE), false).filter(new ResourceFilter(childSelector));

     }

 

+    /**

+     * Provides a stream of the child resources of the base resource. The predicate

+     * is a filter to determine which of the children are returned

+     * 

+     * @param childSelector

+     * @param charEncoding

+     *            char encoding of the branch selector String

+     * @return

+     * @throws ParseException

+     */

+    public Stream<Resource> listChildren(String childSelector, String charEncoding) throws ParseException {

+        return StreamSupport

+                .stream(Spliterators.spliteratorUnknownSize(resource.listChildren(),

+                        Spliterator.ORDERED | Spliterator.IMMUTABLE), false)

+                .filter(new ResourceFilter(childSelector, charEncoding));

+    }

+

 }
\ No newline at end of file