package org.ocpsoft.rewrite.transform.minify;

import java.nio.charset.Charset;

import org.ocpsoft.rewrite.transform.Transformer;

/**
 * A {@link Transformer} implementation that can perform various minification tasks.
 * 
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
public abstract class Minify implements Transformer
{
   private Charset charset;

   /**
    * Specify the {@link Charset} to be used during minification.
    * 
    * @param charset the {@link Charset} to be used.
    */
   public Minify usingCharset(Charset charset)
   {
      this.charset = charset;
      return this;
   }

   public static JsMinify js()
   {
      return new JsMinify();
   }

   public static CssMinify css()
   {
      return new CssMinify();
   }

   /**
    * Get the {@link Charset} to be used during minification.
    */
   protected Charset getCharset()
   {
      return charset;
   }
}

@@ -378,16 +378,43 @@
  charset
+ = Charset.forName(%22UTF-8%22)
 ;%0A%0A   /*

Fix null Charset encoding that was breaking tests :)